Sort on String in column begins with "foo"
Sort on String in column begins with "foo"
I've been searching the docs and forum but I just can't come up with the answer.
I want to sort a column on "begins with this string".
This is where I am now: oTable.fnSort( [ [ 2, $('#name').val() ] ] );
I receive this error: "oSort[iDataType + "-" + aaSort[i][1]] is not a function".
Thank you.
[code]
oTable = $('#expanded_table').dataTable({
"aaData": smallTable,
"aoColumns": [{
"sTitle": "Customer Number"
}, {
"sTitle": "Location"
}, {
"sTitle": "Customer Name"
}, {
"sTitle": "Street Address"
}, {
"sTitle": "City"
}, {
"sTitle": "State"
}, {
"sTitle": "Zip Code"
}],
"bRetrieve": true,
"bJQueryUI": true
});
oTable.fnClearTable();
oTable.fnAddData(smallTable);
// oTable.fnFilter('^' + $('#name').val(), 2, true);
//I don't want fnFilter because it removes the results
oTable.fnSort( [ [ 2, $('#name').val() ] ] );
[/code]
I want to sort a column on "begins with this string".
This is where I am now: oTable.fnSort( [ [ 2, $('#name').val() ] ] );
I receive this error: "oSort[iDataType + "-" + aaSort[i][1]] is not a function".
Thank you.
[code]
oTable = $('#expanded_table').dataTable({
"aaData": smallTable,
"aoColumns": [{
"sTitle": "Customer Number"
}, {
"sTitle": "Location"
}, {
"sTitle": "Customer Name"
}, {
"sTitle": "Street Address"
}, {
"sTitle": "City"
}, {
"sTitle": "State"
}, {
"sTitle": "Zip Code"
}],
"bRetrieve": true,
"bJQueryUI": true
});
oTable.fnClearTable();
oTable.fnAddData(smallTable);
// oTable.fnFilter('^' + $('#name').val(), 2, true);
//I don't want fnFilter because it removes the results
oTable.fnSort( [ [ 2, $('#name').val() ] ] );
[/code]
This discussion has been closed.
Replies
Allan