3.2.0

How to get the XML of a sorted grid?

Is it possible to get the sorted XML after I sort the data in a grid?

for example:

var obj = new Active.Controls.Grid;
var table = new Active.XML.Table;

table.setXML(xml);
obj.setDataModel(table);

obj.Sort(2, "descending");

After this I want to be able to get the sorted Xml so I can submit this back to the server.

If I check table.getXML().xml it is still in it's original state.

Thanks in advance
Robin
January 8,
The sort procedure does not modify the XML source. It just stores the new sequence of row indices in the 'row/values' property. You can get an array of row indices (in display order) from the getRowValues() method.

var rowSequenceArray = obj.getRowValues();
Alex (ActiveWidgets)
January 8,
Alex,

I allready understood that the source xml is not modified, but I was wondering if there was any method that could re-generate the xml from the grid with the right sorting. After thinking about it, maybe it is not really possible for the grid to re-generate the source xml becausethe grid is unaware of it's source.

Thanks anyway.
Robin
January 9,
Yes, you may assign a function as a datasource and in this case the grid knows nothing about internal structure of the datasource.
Alex (ActiveWidgets)
January 9,

This topic is archived.

See also:


Back to support forum