Page 1 of 1

Navigation From Button in Data Grid

Posted: Wed Apr 23, 2014 6:39 pm
by dcpbarrington
Forum,

I have a Data Grid table that has a large number of columns. I have added a column labeled "Edit" and put in a button in each of the rows.

I would like the user to be able to click on the EDIT button and navigate to a separate Card to do the data entry instead of in the Data Grid.

I did the following in the Edit column Behavior script. It does the navigation, but from that point on all Data Grid functionality Fails. I assume that something in the Data Grid was not cleaned up so you cannot jump to a different card.

Code: Select all

on mouseUp pTheButton
   if (pTheButton is 1) then
      switch the short name of the target
         case "Edit"
            go to card "EditCard"
            break
      end switch
   end if
end mouseUp
I then added a mouseUp function for the Data Grid Table. That will execute, but I don't see a function that can give me what column the user just selected, so I'm unable to determine when the EDIT button is selected. Maybe I'm missing something.

Is there some other way to define a Button in a Table that will take you to a different CARD?

Thanks for the HELP..
d

Re: Navigation From Button in Data Grid

Posted: Wed Apr 23, 2014 6:56 pm
by Klaus
Hi d,

oh well, datagrids... :D

Here is how to get current row data:

Code: Select all

on mouseUp pTheButton
   if (pTheButton is 1) then
      switch the short name of the target

      ## What is the current INDEX, maybe store it for later use like writing data back into that index in the datagrid!
      put the dgIndex of me into tIndex

      ## "Pull" out the data associated with this index:
      put the dgDataOfIndex[tIndex] into tRowData
      ## Now tData contains a one dimensional array that you can do with whatever you want :-)

         case "Edit"
            go to card "EditCard"
            break
      end switch
   end if
end mouseUp
Hope that helps!


Best

Klaus

Re: Navigation From Button in Data Grid

Posted: Wed Apr 23, 2014 8:05 pm
by dcpbarrington
Klaus,

Thanks for your quick reply on how to get information from the selected row of data.

That is not quite what I'm trying to do. I want to go to a different card when the person selects the button in the Data Grid Table.

When I use the "Go To Card" syntax in the behavior script of the Data Grid, Data Grids stop working in any way after that point. That is a BIG PROBLEM.

So is there any way that you can put a navigation button within a Data Grid table?
I could put the EDIT button outside of the Data Grid and then determine what line has been highlighted, but that doesn't seam as clean, but maybe that is what I need to do.

Thanks
dan

Re: Navigation From Button in Data Grid

Posted: Thu Apr 24, 2014 10:48 am
by Klaus
Hi Dan,
dcpbarrington wrote:When I use the "Go To Card" syntax in the behavior script of the Data Grid, Data Grids stop working in any way after that point. That is a BIG PROBLEM.
ouch :shock:

Well, that should of course work! If this can be reproduced, I consider this a bug. :(
Is there anything in the card script, where th datagrid is on, or anywhere else that might cause this inconveninece?

Whatever, in that case you should use "plan B" (from outer space) and create a button outside of the datagrid for navigation.
To get the data in the script use:
...
put the dgHilitedIndex of grp "your datagrid here..." into tIndex
put the dgDataofIndex[tIndex] of grp "your datagrid here..." into tDataArray
## do something with tDataArray.
...

Best

Klaus

Re: Navigation From Button in Data Grid

Posted: Tue Jul 01, 2014 9:54 pm
by dcpbarrington
Forum,

I resolved this issue by deleting the DataGrid and starting from scratch. I added a Button to the column and removed the input field and generated the script.

Don't know what I did differently the second time, but now I'm able to select a button in the DataGrid and go to another card without the original issue.

Hope this helps.
Dan

Re: Navigation From Button in Data Grid

Posted: Wed Jul 02, 2014 12:43 am
by Klaus
Hi Dan,

GREMLINS! :D
Glad you could solve it.


Best

Klaus