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

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
LC4iOS
Posts: 88
Joined: Tue Dec 03, 2013 8:15 pm

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

Post by LC4iOS » Fri Dec 20, 2013 4:57 am

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

...


Thanks to RunRev.
Thanks to LiveCode forum members.

LiveCode v5.5.5 - iOS Android Mac Windows - 6.5 Community
27" 2012 iMac i5, MacBook Pro, MacBook Air, iPhone 5, iPhone 4
xCode 5.0.2 - iOS7 - OS X Mavericks
Paid Apple iOS Developer Program Member

Post Reply