Page 1 of 1

Is there an easier way to extract the DataGrid Checked Rows?

Posted: Fri Dec 20, 2013 4:57 am
by LC4iOS
Just playing around with the DataGrid.

Wondering if there is an easier way to retrieve all the rows in a DataGrid that have been checked.

I used the DataGridHelper sample for making the first column a CheckBox.


Code: Select all

   

...

set the itemDel to TAB
   put true into pIncludeColumnNames
   put the dgText [pIncludeColumnNames] of group "DataGrid 2" into MydgText
      answer MydgText
   --   answer item 1  of MydgText
   --   answer item 3  of line 2 of MydgText
   
   repeat for each line myLine in MydgText
      add 1 to tLineIndex
      if myLine is Not empty then
         if the first item of myLine is "true" then
            put tLineIndex & "," after myTickedRowIndexes
            put item 2 of myLIne & "  " & Item 3 of myLine & "," after myTickedRowUniqueValues
         end if
      end if
   end repeat
   
   answer myTickedRowIndexes
   
   set the LineDel to Comma
   replace comma with cr in myTickedRowUniqueValues
   
   answer myTickedRowUniqueValues

...