Sorting Dynamically generated HTML Table - sorting

I am generating a dynamic HTML table string and displaying inside a div. I am assigning ID and runat server in that string. eg.
string s="<table id='tblAll' runat='server'></table>".
This string is generated on some different page, and its passed as XmlhttpResponseText
I want to apply sorting on this table, It would be great if any one can help me out.
Thanks

You can use jQuery tablesorter plugin

Use the jQuery tablesorter plugin, and instead of selecting the table via it's Id, you can select it via the containing div and a child selector:
$("div#container table").tablesorter();

Related

Nokogiri without DIV

I am trying to scrape information from an HTML table. There are multiple tables on the page. Before each table there is a paragraph with text. I want to key off of this text field ("CONSOLIDATED" text in the pastebin below) to identify the table since there are no DIV tags on the page and therefore no other way to uniquely identify the table. How would I do this? What XPath statement would I use? Here's a link to the HTML page: http://pastebin.com/HeapZvPV
Thanks!

How to Update Jquery Data Table

I am using Jquery data table plugin. I was able to display it properly with filtering, sorting and Paging.
But, now the problem is i need to filter the data table rows based on dropdown selection made.
but, i do not have any idea how to do this..I am very new to MVC. So, here i need to send that dropdown selected item as parameter to a server side method and call a method and rebind data to the data table.
I am initially binding data to the data table using for loop and iterating over a datatable
Do i need to use Ajax here..if so how to get the new datatable/data to this view and bind to data table?
Please suggest the way to do..
you use the jquery datatable for this
create function and paste jquery datatable code in there
then call this function on dropdown selection change using jquery.
Tips :jquery datatable code available on net find and use it

Smarty to check select box value

I have two HTML Forms in a webpage. One having a select box. So i may want to check in second form if first form has selected some value and if it has, capture that value. I am using Smarty templates for these HTML form. Is there some workaround with this ? Thanks.

Accessing the whole table when using the tablesorter and tablesorterPager jQuery plugin

I am using the tablesorter and tablesorterpager plugin and I really like it.
http://tablesorter.com/docs/
http://tablesorter.com/docs/example-pager.html
However I need help with a problem I have. I use checkboxes for every row in a table for selecting items. I also have a “select all” checkbox in the table header.
When looking at the pager script I understand that the plugin completely removes all the table rows from the DOM and only renders the visible rows, the rest of the table is cached.
So when using code similar to this:
$("#theTable").find("input[name='cbitems']:not(:disabled)").each(
I will only get elements currently visible. Not elements in "hidden" pages.
So my question is; is there anyway to make the cached table accessible?
For example:
$("#theTable").cachedTable.find("input[name='cbitems']:not(:disabled)").each(
I have tried reading up on object oriented javascript (or what to call it), but no success.
To answer my own question:
The cached table is accesible, I had just left out the [0] part.
$($("#theTable")[0].config.rowsCopy).each(function() {
$(this).find("input[name='nodeitems']:not(:disabled)").attr('checked', check);
});

div loading is not proper while using ajax

I have to load a div with a list of check boxes using ajax. I have writen ajax code to fetch the string containing the list of check boxes.`
document.getElementById("roleCheckBoxes").innerHTML="";
$('#roleCheckBoxes').append(xmlhttp.responseText.toString());
the data are fetching properly but the display alone not reflecting the string which I gave instead it displays a the list of check boxes with all checked.
Maybe the checkboxes in the HTML you get contain checked="true"?

Resources