Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Klaus Kohlschütter on Mar 11, 2009 09:14
open dhtmlx forum
Getting content of selected rows of one column

Hi,

I'm using the pro version of your tool.

I'm looking for a method to get the contents of selected rows, but just of one specified column. I tried the following script
but I do not want the complete set of values. I want to get just the value may be komma separated.

dhtmlXGridObject.prototype.serializeSelected = function(){
var out = "";
if ( this._mathSerialization )
this._agetm="getMathValue";
else
this._agetm="getValue";
for( var i=0; i<this.selectedRows.length; i++ ) {
out += this._serializeValues( this.selectedRows[i] );
}
return out;
}

Could you help me?

Klaus
Answer posted by Support on Mar 11, 2009 09:26

To get cell's value you can use getValue() method:

var value=mygrid.cellById(rowId,cellInd).getValue()

If you are using multiline mode you can get id's of selected rows with getSelectedRowId(), in mulselection mode method returns list of ids with default delimeter (comma)