override sort <alex code> with rowtext adjustments problems..
hi!
i want to change the row indexing of the grid..
example.. set the 1st row index to 5..
i was able to do this with
obj.setRowText(function(i){return startingRow + i});
//grid..
[5][a]
[6][c]
[7][b]
.
.
.
.. but wenever i sort the grid via column header, the indexing are reshufffled..
//grid..
[6][c]
[7][b]
[5][a]
.
.
.
so i used the code posted by alex about the over ride sort..
$html .= " var mySort = function(src){\n";
$html .= " var i = src.getProperty('item/index');\n";
$html .= " var rows = this.getProperty('row/values');\n";
$html .=" rows.reverse();\n";
$html .= " this.setProperty('row/values', rows);\n";
$html .= " this.setProperty('sort/index', i);\n";
$html .= " this.setProperty('sort/direction', 'ascending');\n";
$html .= " this.refresh(); \n }\n";
$html .= " obj.setAction('columnSort', mySort);\n";
<never mind the $html..>
the sorting now works.. but it sorts according to the row index, not with the data under the column header..
problem is: how to manage the row indexing according to the my variable starting row and stil be able to sort the data acc to the clicked column header and stil retain the inc row index values set in the row header.. tnx..
=) hope to get some answers..
i want to change the row indexing of the grid..
example.. set the 1st row index to 5..
i was able to do this with
obj.setRowText(function(i){return startingRow + i});
//grid..
[5][a]
[6][c]
[7][b]
.
.
.
.. but wenever i sort the grid via column header, the indexing are reshufffled..
//grid..
[6][c]
[7][b]
[5][a]
.
.
.
so i used the code posted by alex about the over ride sort..
$html .= " var mySort = function(src){\n";
$html .= " var i = src.getProperty('item/index');\n";
$html .= " var rows = this.getProperty('row/values');\n";
$html .=" rows.reverse();\n";
$html .= " this.setProperty('row/values', rows);\n";
$html .= " this.setProperty('sort/index', i);\n";
$html .= " this.setProperty('sort/direction', 'ascending');\n";
$html .= " this.refresh(); \n }\n";
$html .= " obj.setAction('columnSort', mySort);\n";
<never mind the $html..>
the sorting now works.. but it sorts according to the row index, not with the data under the column header..
problem is: how to manage the row indexing according to the my variable starting row and stil be able to sort the data acc to the clicked column header and stil retain the inc row index values set in the row header.. tnx..
=) hope to get some answers..
rach
September 9,