javascript - Using Jeditable and activating on click -
I'm almost exactly what I'm trying to do. I'm working, I can get the default setup to work. I am able to get code in the above forum to work. I believe my problem is that because I am using a table, I need something else to select the previous element
This is my html
< Pre> & lt; Table & gt; & Lt; TR & gt; & Lt; Td width = "5%" & gt; Input class = "cat_checkbox" type = "checkbox" name = 'delete_cat []' value = '& lt ;? Php echo ("$ cat_idata [cat_id]");? & Gt; '/ & Gt; & Lt; / TD & gt; & Lt; Td width = "90%" square = "edit_cat_title" id = 'unique_id' & gt; Category & lt; / Td> & Lt; Td width = "5%" & gt; & Lt; A href = "#" class = "edit_cat_title_trigger" & gt; & Lt; Img src = "image / edit.gif" range = "0" & gt; & Lt; / A & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt;
And here's my JQuery:
// Modify title material at flight $ ('. Edit_cat_title'). Editable ('action.php', {Name: 'cat_title', indicator: 'Saving ...', Submit: 'OK, Cancel:' Cancel ', Tooltip:' to edit Click ', event:' edit '}); // Edit image trigger with the click of $ (". Edit_cat_title_trigger") Bind ("click", function () {$ (this) .prev (). Trigger ("edit_cat_title");});
I know that maybe I should be able to understand it and I know what I have to do $ (this) .prev () Trigger ("edit_cat_title");
On the right thing, but I'm still really new to Jquery
Editing event Instead of being dependent on the DOM structure to trigger, you might want to consider setting up a Reliance tag on those two groups more closely than this will make your code even slightly lower than your markup. Then the selector will only be $ ('. Edit_cat_title'). Filter ('[rel =' + $ (this)) .attr ('rel') + ']')
Comments
Post a Comment