Set first row active programaticaly
I never found a clue...
But it should be realy easy...
How do I set some row (specially the first one) to be selected ?
I had to do all background operations via SQL querries (PHP) putting them into JS array. The form on the page should display details of the records in the grid. But when query is done none row is selected making a little problems with the rest of form.
I need some way to select first row right after query to update the form.
Thanx for advice..
ASJ
ASJ
April 8,
Use the following in your script to highlight first row in grid
//highlight first row by default
obj.setProperty("selection/index", 0);
GuiBuilder
April 12,
Hi,
I'm trying to do similar, however i can't get the above code to work.
Once the table has loaded, i want the first row highlighted (as if clicked)
Using the above method, nothing happens...
Any further pointers ???
Thanks
Andy
September 27,
hello,
try using this
obj.setSelectionIndex(0);
glennlosentes
September 27,
Thanks for the pointer, it works !!!
HOWEVER ....
I now want to get a bit more advanced and make the index (row number variable).
Basically whilst building the table if data in myData[i][0] == a pre-determined value i want to focus (setSelectionIndex) to [i].
My program looks sound however it sets focus to [i] when matching, but subsequent lines (no match) focus the selection index back to zero.
Is there a way of only setting the focus when at the end of the table to overcome this ???
Hope this makes sense.
cheers
Andy
September 27,
huh?!!?
setSelectionIndex before....
document.write(obj)
i hope this will help.
i didnt get you.... sorry.....
glennlosentes
September 29,
I dont know if anyone help me here, but I am hoping. I have been searching the forum for a hour or so and I can not come up with a good answer. I want to do the same as the above posts...set the active row programaticly. But in my case I want it to happen when a button is pressed.
I have my grid with a list of files and then a button to which I would like to force the a specific row to be selected.
I use:
obj.setSelectionProperty("index", 0);
to force the first row to be selected on load, but for some reason I can not use that same code in the onclick event of a button.
Has anyone done this before? Can I get some help on this one.
Thanks.
Aaron
December 2,