We help IT Professionals succeed at work.

Jquery facebox plugin in Flexigrid

newbie27
newbie27 asked
on
574 Views
Last Modified: 2011-10-19
Hello Experts,
I am using Jquery plugin Facebox to allow user to enter extra info for one of the field in the Flexigrid.
All it does is when you click an icon a dialog will appear, once can enter some  text and close by pressing OK. The entered text will be shown back in the cell. It works just fine. However, on the same click the entire row is getting selected which I want to deselect it soon you close facebox.
Please see the attached screenshot for better understanding of what I am trying to say you here.
I hope someone can help?
Thanks
Sam
Comment
Watch Question

Author

Commented:
please see the attached or if you can please visit the url
http://213.253.134.6/artism/admin/list_admin.asp#istest

screenshot.jpg
b0lsc0ttIT Manager
CERTIFIED EXPERT

Commented:
How is the Deselect option run?  Could that be used onclose of Facebox to deselect the item?  If you need specific help with that could you help to point to the code that "runs" when Deselect is pressed.

bol

Author

Commented:
Hello,
Thanks for your comment, there is a class for the Flexigrid row,

I have used the below statement to deselect all the selected rows
$('.bDiv tbody tr',grid).removeClass('trSelected');

I think I can use the same when I close the Facebox but did not worked for me

i think i am unable to pick the 'grid' value, which I believe is the Flexigrid name.

Please can you advice

thanks for your help
b0lsc0ttIT Manager
CERTIFIED EXPERT

Commented:
OK.  I was looking and thinking on the same lines.  I was wondering what grid came from and could see  that as a problem but a line like the one above at the start of the saveData function (the one called onclose of Facebox) is just what we need.  Let me look at the html to see if I can find a way to reference the tr tag we need.  The  removeClass is what we will use either way.

Hopefully I can find another way to do it without using grid but it might be nice if you could figure out what that does in the jQuery above.

bol

bol
b0lsc0ttIT Manager
CERTIFIED EXPERT

Commented:
Can you just leave grid out?  I am not sure why it is needed and that would probably be the easiest way to do it, just clear all tr tags of using that class in the table.

Add the line above to the saveData function but leave out grid.

$('.bDiv tbody tr').removeClass('trSelected');

Let me know how that works.

bol

Author

Commented:
Thanks Bol,

this is equivalent
$('.bDiv tbody tr',grid).removeClass('trSelected');

to this
  $('.bDiv tbody tr','listDisplay').removeClass('trSelected');

I tried adding this line in the saveData function after adding the text to the cell but is not doing it

thanks for your help




function saveData(d)
	{
          if(!orig[d]){
            orig[d]=$("#"+d).html();
          }
		  
		 // alert(d); 
          if($("#theText").val() != ''){
                $("#"+d).html( $("#theText").val() )
			   //$("#"+d).html( orig[d] + "  " + $("#theText").val() )
          }
          else{
                $("#"+d).html( orig[d] );
          }
		    $('.bDiv tbody tr','listDisplay').removeClass('trSelected');
	}	
		

Open in new window

Author

Commented:
Thanks Bol,
tried as you suggested above but that did not work either...
IT Manager
CERTIFIED EXPERT
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
thanks

Author

Commented:
Bol,
This has worked, I was adding the line in a wrong place....
thanks for your help
b0lsc0ttIT Manager
CERTIFIED EXPERT

Commented:
Your welcome!  I made a small test page to see if how the jQuery would work and it seemed to be good.  I am glad it was just the wrong place.  Thanks for the grade, the points and the fun question.

bol
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.