Sorting on input textbox
Sorting on input textbox
Hello,
I want to sort on textboxes value but i cant get that to work.
When i try to sort a table containing input textboxes i this error:
"a is undefined" on line 75 in the jquery.datatable.js file.
Im using this code:
[code]
jQuery.fn.dataTableExt.afnSortData['dom-text'] = function(oSettings, iColumn) {
var aData = [];
$('td:eq(' + iColumn + ') input', oSettings.oApi._fnGetTrNodes(oSettings)).each(function() {
aData.push(this.value);
});
return aData;
}
jQuery(document).ready(function() {
// Putter DataTable p
I want to sort on textboxes value but i cant get that to work.
When i try to sort a table containing input textboxes i this error:
"a is undefined" on line 75 in the jquery.datatable.js file.
Im using this code:
[code]
jQuery.fn.dataTableExt.afnSortData['dom-text'] = function(oSettings, iColumn) {
var aData = [];
$('td:eq(' + iColumn + ') input', oSettings.oApi._fnGetTrNodes(oSettings)).each(function() {
aData.push(this.value);
});
return aData;
}
jQuery(document).ready(function() {
// Putter DataTable p
This discussion has been closed.
Replies
I solved this one myself. I forgot to change the "$" symbol to "jQuery". I need to do this because im also using the Prototype Javascript library in my webapplication.