Neil KolbanMay 16, 2016 at 7:56 pm #1807
Imagine I have a table Coach View and the last column in the table contains a Button. In my “On Click” handler for the button, I would like to determine the underlying table data index corresponding to the button clicked for that row. For example, if I click on a button on row #3 of a table, I would like to know that it was index 2 (the third list element) that was clicked. This is not related to row selection as I may be using a table with no selections enabled.Stu LeibowitzMay 16, 2016 at 8:29 pm #1809
I believe it would be: me.ui.getIndex()Neil KolbanMay 18, 2016 at 10:05 am #1816
Nice. Thank you kind sir. I haven’t tested it yet but reading here:
It seems like you are 110% correct.Rackley BorenMay 20, 2016 at 3:31 pm #1828
Thanks for answering that one! Double confirming you are correct. Yay community!
Rackley BorenJeremy KongJune 2, 2016 at 3:22 pm #2016
I was playing with this with the Service Data Table, but .getIndex() only sort of works. The issue is that if you have multiple pages of table results, then the .getIndex() doesn’t work properly. Might be a bug, or might be usage of the wrong method. The behavior I observed is depending on the order you clicked the pages: e.g. page 1, then page 3, then page 2. It assigns the index based on the order you rendered them which depends on which order you show a page.
This method works across multiple pages of rows, etc. which is:
This works for ServiceDataTableControl as well.jmacJune 23, 2016 at 10:50 am #2230
The method you are suggesting will work for Tables, but Service Data Tables do not contain views, so I am not sure how you got this to work for a Service Data Table. The columns in a service data table can only render as Simple HTML or Custom; Coach View is not one of the options. If you got this to work I would really like to see the code you used.
ThanksMaciej SzleminskiOctober 7, 2016 at 11:19 am #2834
To this tune
I’m struggling to bind the index of the button clicked to a control outside of the table. Help! 🙂
Ie. what am I doing wrong with this picture. I’ve tried page.ui.get and many other combinations but I can only get different types of error, can’t make it work! 🙁
I want to set the ButtonIndex (which is an integer) to the index of the row which contains the button that was clicked. Help! 🙂Maciej SzleminskiOctober 7, 2016 at 11:31 am #2836
Never mind. This was so dumb. I had it set to a stock coach integer, not the Spark Integer. 🙁 The simplest errors are the hardest to figure out.SPARK SupportOctober 7, 2016 at 12:18 pm #2838
I’m glad you found the solution.
You must be logged in to reply to this topic.