3.2.0

Multi Select Funtion in Active Widget Grid

Can anyone let me know a JavaScript function or ActiveWidgetGrid method to select Multiple Rows with similar values ?? Use the Ticker example suppose there are 3 records with the same Company name(Microsoft) . When I select 1 record ,all 3 should get selected.
Sachin Paradkar.
April 26,
Here is the function based on Ticker column (0) :

obj.setAction("click", function(src){
 var similarcelltext = new Array();
 var TheRowTicker = myData[src.getRowProperty('index')][0];

 for(x=myData.length-1;x>-1;x--){
 if(myData[x][0] == TheRowTicker){ similarcelltext.push(x) }
 }
 window.setTimeout(function(){
 obj.setSelectionValues(similarcelltext); 
 },300)
 });


But if you want to a more general search [ i.e. "the text" (of the clicked cell) in the same position (column) for all rows then:
obj.setAction("click", function(src){
 var similarcelltext = new Array();
 var Thetextclicked = src.getItemProperty("text");
 var colclicked = src.getColumnProperty('index');

 for(x=myData.length-1;x>-1;x--){
 if(myData[x][colclicked] == Thetextclicked){ similarcelltext.push(x) }
 }
 window.setTimeout(function(){
 obj.setSelectionValues(similarcelltext); 
 },300)
 });


An for Version 2.0 use:
obj.onCellClicked = function(event, col, row){
 var similarcelltext = new Array;
 var Thetextclicked = this.getCellText(col, row)
 for(x=myData.length-1;x>-1;x--){
 if(myData[x][col] == Thetextclicked){ similarcelltext.push(x) }
 }
 obj.setSelectedRows(similarcelltext);
 }

HTH

Carlos
December 15,

This topic is archived.

See also:


Back to support forum