in this line
nash.Invoke("selectRows",Array(tblCB,1,6))
the 1 and 6 are the limits
ie the col.value is compared to the 2 values, it must be between 1 and 6 in this case
this line chooses which column you are comparing
if (i[0] >= from && i[0] <= to)
In this case its column 0
It looks like you need col 1 which would be i[1]
if column holds a string which is a date, you could pass the date range to the function in place of the 1 and 6
ie
nash.Invoke("selectRows",Array(tblCB,startdate,enddate))
or
nash.Invoke("selectRows",Array(tblCB,"2015-01-01","2015-06-06"))
or replace
function selectRows(table,from,to){
table.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE)
for each(i in table.items){
if (i[0] >= from && i[0] <= to){ //compare col 0 to value
table.getSelectionModel().select(i)
}
}
}
with
function selectRows(table,col,from,to){
table.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE)
for each(i in table.items){
if (i[col] >= from && i[col] <= to){ //compare col.value to limits
table.getSelectionModel().select(i)
}
}
}
and call with
nash.Invoke("selectRows",Array(tblCB,1,"2015-01-01","2015-06-06"))
and you can specify the column to compare in the call ( the 1 as second parameter)
this code
function selectedPrint(table){
table.getSelectionModel().getSelectedItems().forEach(function(aa){print(aa[0],"-",aa[1])})
}
simply prints out col 0 value "-" col 1 value
again the aa[0] and aa[1] specify the columns to print (col 0 and col 1 in this case)
The last routine getSelected(table) simply returns a list containing all of the selected rows (each item is an object containing the entire row)