In my web application, I had to add dynamic / delete rows from my html table using jQuery.
$ (function () (/) * Existing table * / // one line $ Add new row to HTML template of "(contact #"). Each (function () {$ ("button.addCommentRow", this) .live ('click', function) {var curr_row = $ (this) Html = '& lt; tr & gt; & lt; td & gt; gt; & lt; td & gt; & lt; / td & gt; & lt; at the closest (' tr '); ; TD & gt; gt; & lt; TD & gt;
| | | '+ col_ninth +' & L T; / td> gt; td & gt; & gt; button type = "button" class = "addCommentRow" & gt; + & lt; / button & gt; & gt; button type = "button" square = "DeleteCommentRow" & gt; - & lt; / button & gt; & lt; / td & gt; & lt; / tr & gt; Var newre = $ (Html) .insertAfter (curr_row); // last new Add after 'row.find' ('.com.conduitRow, .deletecommentRow'). Button (); ... NewRow.find ('. DeleteCommentRow') Click on the button () (function {} {newRow.find ("TD: nth child (9)") delete (); newRow.find ("TD: nth (10) "). Remove ();}); }); }); }); So, on the removal, I wanted to remove the 9th and 10th TD elements from my line. The above code (excluding part) does not seem to be highly appreciated any thoughts / suggestions to work. Thanks, Chitish : & lt; Table border = 2> & Lt; TR & gt; & Lt; TD & gt; JQuery & lt; / TD & gt; & Lt; TD & gt; Mootools & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; Dojo & lt; / TD & gt; & Lt; TD & gt; Fuel & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; Raphael & lt; / TD & gt; & Lt; TD & gt; Rico & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; SproutCore & lt; / TD & gt; & Lt; Td> The lively kernel & lt; / Td> & Lt; / TR & gt; & Lt; / Table & gt; JavaScript : $ (function () {$ ('tr'). Find ('td'). Parent () // Travising for 'tr' element .append ('& lt; td & gt; & lt; input type = "button" value = "delete" class = "del" Gt; & lt; Input Type = "Button" value = "Delete Row" category = "Delo" /> gt; & lt; / td & gt; '); $ ('. Del ') Click (function {$ (This) .Parent (). (); // Delete TD element}} $ ('.'). Click (function () {$ (this) .Parent () .Parent (). Remove (); // delete the line (tr) element});});
Popular posts from this blog
I hope this is a good question to ask here. This programming is related, so I thought it would be better than the superuser, so I am using the CDT C ++ Eclipse plugin. I know how the editor changes colors for some things But is there a way to do that all the variables are different colors? For example in KDEValue, it sets the local variables and square variables in different colors and bold square squares. Can I copy it to CDT? Eclips provides some level of color customization for text editor syntax You can see it on the following: There are many elements, including the Window> Preferences> C / C ++> Editor> Syntax color code that can be changed, assembly, Comments, Preprocessor and Doxian Under the code, it is possible to change the color of some variable types, such as global variables, local variable announcements, local variable references, and parameter variables. But I do not think the code is capable of changing the color of each variable declared....
$ (दस्तावेज़) .ready (function () {function ajaxselectrss (rssurlvar) {var ajaxRequest; // वेरिएबल जो अजाक्स को संभव बनाता है! कोशिश करें कि {// ओपेरा 8.0+, फ़ायरफ़ॉक्स, सफारी अजाक्स अनुरोध} = नया एक्सएमएलएचटीपीआरइवेस्ट ();} कैच (ई) {// इंटरनेट एक्सप्लोरर ब्राउज़र्स {ajaxRequest = new ActiveXObject ("Msxml2.XMLHTTP");} पकड़ो (ई) {try {ajaxRequest = new ActiveXObject ("Microsoft.XMLHTTP");} कैच (ई) {// कुछ गलत चेतावनी ("आपका ब्राउज़र तोड़ दिया!"); वापसी झूठी;}}} // एक बनाएं फ़ंक्शन जो सर्वर से भेजे गए डेटा प्राप्त करेंगे ajaxRequest.onreadystatechange = function () {if (ajaxRequest.readyState == 4) {var ajaxDisplay = document.getElementById ('news'); ajaxDisplay.innerHTML = ajaxRequest.responseText;}} / / Var rssurlvar = $ (this) .attr ("title"); var queryString = "rurl =" + rssurlvar; var urltofile = "rssget.php"; ajaxRequest.open ("पोस्ट", urltofile, सच); ajaxRequ Est.setRequestHeader ("सामग्री-प्र...
Well, I'm using a custom window box that comes with some custom control boxes that accompany the text The producers who are displayed are called. I have a defined event, which has been subscribed through the original class, it gets burnt when clicking on the button. However, I can not see how to use it effectively, I would like to return one yes, whether yes or not, but obviously my code will continue to execute, so this Below is some example code to clarify the problem that the method has subscibed by clicking on the button. Message box window Public partial class custom message box: window {public representative message messagebox object sender, event events e); Public event messagebox handler messagebox document; Public Customs Box () {Initial group (); } Public Customsbox (String Message) {InitializeComponent (); This.txtdescription.Text = Message; } Public Customsbox (String Message, String Title, String First BTNtext) {Initialization (); This.lbltitle.Content =...
| |
Comments
Post a Comment