PDA

View Full Version : Problem with column sort



yevgen
12 Mar 2007, 9:37 AM
Column sort doesn't work with a grid which was created using addRow function.
It looks like function createNode called from function addRow doesn't work properly.


var xmlstring = '<?xml version="1.0"?><Report><Row></Row></Report>';
if (typeof ActiveXObject != "undefined") {
var xmlobject = new ActiveXObject("MSXML.DomDocument");
xmlobject.loadXML(xmlstring);
}
else {
var xmlobject = (new DOMParser()).parseFromString(xmlstring, "text/xml");
}
dataModel.loadData(xmlobject);
grid.render();

/*
* processing cell parameters
* URL
* Action
* Text
* add rows into grid. grid must be rendered before.
*/
/**/
var newRow = new Array(fields.length);
for (var i = 0; i < gridData[1].length; i++){
for (var j = 0; j < gridData.length; j++){
if (gridData[j][i][2] == ''){gridData[j][i][2] = ''};
if (gridData[j][i][0] == ''){
newRow[j] = gridData[j][i][2] ;
}
else {
//newRow[j] = '[i][0]) + ']' + gridData[j][i][2] + ' (' + urldecode(gridData[j)' ;
newRow[j] = gridData[j][i][2] ;
}
}
dataModel.addRow(null,newRow);
}
// first empty row must go away

dataModel.removeRow(0);


http://www.floridawebdev.com/images/grid1.JPG


http://www.floridawebdev.com/images/grid2.JPG

LordMX
1 Apr 2009, 2:42 AM
Hi, I have the same problem, can someone help us to solve this problem?
...actually, I have a grid, with rows added with addRow, and that works, but, I when I want to sort the data inside that grid nothing happening, I want to sort a grid without server side programming and resiving data for recreating grid, (is it possible to do that, to sort some column like that?)

Cheers

tryanDLS
1 Apr 2009, 9:32 AM
This thread is ancient - are you really using 1.x? If not, please create a new thread in 2.x bugs with a working example.

LordMX
2 Apr 2009, 2:32 AM
Yes, I'm using 1.x.