on 12-06-2005 8:35 AM
any efficient solution to set focus line in a table after the data is reloaded?
For example, I create a record, and how to set focus on this newly created record? PS: the Id for this new record is generated before the data is reloaded.
Wei,
0. You have some ID that correspon to node element attribute
1. Use simple "for" loop over node elements till you find element with attribute equals to ID
2. Set node lead selection to element found: node.setLeadSelection( nthElement.index() );
VS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bhavik,
As my table is a tree table, the new line will be created under the parent record. So it does not always appear at the bottom.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for all of your advice.
In my case, maybe loop is necessary as the newly created does not always appear in the last line.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Wei,
Instead of doing for loop take the size of the node in which you have created the element.
Lets say:
int size = wdcontext.node<node name>().size();
As you have just added newly created element in node it is at the last position.
So, you can write following line of code to set focus on the newly created element:
wdcontext.node<node name>().moveLast();
OR
wdcontext.node<node name>().setLeadeselection(size-1);
Regards,
Bhavik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check the position of the newly created row and
wdContext.nodeParentNode().setLeadSelection(pos);
Hope this will solve ur probs
AD
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hai wei
can you explain your problem a bit more
regards
saravana
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.