Complex: Sorting grid with different row elements
Complex: Sorting grid with different row elements
f.dalpozzo
Posts: 8Questions: 0Answers: 0
Hi all,
I have an ASP.NET gridview where I modify data in-line (span becomes input text after pressing edit row button) then I save by clicking save row button. I use DataTables with sorting enable and bStateSave = true
[code]
$(function() {
$('#<%= grdCategorieProdotto.ClientID %>').dataTable({
"bFilter": false,
"bProcessing": false,
"bAutoWidth": true,
"bSortClasses": false,
"iCookieDuration": 60 * 60 * 24,
"iDisplayLength": 10,
bStateSave,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aoColumns": [
{ "bSortable": false },
{ "sType": "html" },
{ "sType": "html" },
{ "sType": "html" },
{ "sType": "numeric" },
{ "bSortable": false }
]
});
});
[/code]
When I have at least one column sorted and I click on e.g. the 3rd edit row button:
- postback reload the grid
- the edit row's spans become input text
- the edit row is shifted at first position (#### not wanted ####).
Note that if no order is initially setted the edit row remains in 3rd position.
The question is: how can I apply sorting with rows different type of elements? (span, input, select....)
Thanks in advance
Fab
I have an ASP.NET gridview where I modify data in-line (span becomes input text after pressing edit row button) then I save by clicking save row button. I use DataTables with sorting enable and bStateSave = true
[code]
$(function() {
$('#<%= grdCategorieProdotto.ClientID %>').dataTable({
"bFilter": false,
"bProcessing": false,
"bAutoWidth": true,
"bSortClasses": false,
"iCookieDuration": 60 * 60 * 24,
"iDisplayLength": 10,
bStateSave,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aoColumns": [
{ "bSortable": false },
{ "sType": "html" },
{ "sType": "html" },
{ "sType": "html" },
{ "sType": "numeric" },
{ "bSortable": false }
]
});
});
[/code]
When I have at least one column sorted and I click on e.g. the 3rd edit row button:
- postback reload the grid
- the edit row's spans become input text
- the edit row is shifted at first position (#### not wanted ####).
Note that if no order is initially setted the edit row remains in 3rd position.
The question is: how can I apply sorting with rows different type of elements? (span, input, select....)
Thanks in advance
Fab
This discussion has been closed.
Replies
Sorting without HTML tags (i.e. removing span etc): http://datatables.net/examples/advanced_init/html_sort.html
Live DOM sorting on input elements: http://datatables.net/examples/plug-ins/dom_sort.html
Allan