PDA

View Full Version : Outline Question



breckster
16 Dec 2009, 12:30 PM
I have an outline from Domino that has 2nd level components named the same

Example

Outbound
inbox
active
inactive

Inbound
inbox
active
inactive

When you click on an outline entry it is highlighted, the view opens in the tab correctly.

However when you have both Outbound\inbox and Inbound\inbox opened as the same time, the tab title is the same "inbox"

My end users are requesting the focus of the outline follow the active Tab.

Now I can move the focus of the outline programatically using

Ext.getCmp('quoteoutline').getNodeById("xnode-64").select() (I retrived the nodeid manually)
but that is assuming I know the NodebyId within the panel that is active at the time. (Which I don't)

I thought about changing all the panelIds to represent the NodeId.


Any suggestions!

Thanks

Zakaroonikov
16 Dec 2009, 1:36 PM
Could you not look at the viewUrl attribute of the UIView gridpanel on the active tab? If you know the url of the view you are showing on the active tab you can get the root node of the treepanel and write a custom findChild function. Perhaps adding something like this to the UIOutline:



/**
* Finds the first child node that has the 'extndHref' attribute with the specified value.
* @param {String} viewHref The href of the view to search for
* @return {Node} The found child or null if none was found
*/
findChildView : function(viewHref){

var rootNode = this.getRootNode();
var cs = rootNode.childNodes;
var parseViewHRefLC = ((viewHref.indexOf('?') > 0) ? viewHref.split('?')[0] : viewHref.split('!')[0]).toLowerCase();
for(var i = 0, len = cs.length; i < len; i++) {
var parsedExtNDHrefLC = ((cs[i].attributes['extndHref'].indexOf('?') > 0) ? cs[i].attributes['extndHref'].split('?')[0] : cs[i].attributes['extndHref'].split('!')[0]).toLowerCase();
if(parseViewHRefLC === parsedExtNDHrefLC){
return cs[i];
}
}
return null;
},


I am doing a bit of parsing above to remove the url request and parameters and making it all lowercase.

breckster
17 Dec 2009, 9:44 AM
Thanks Zakaroonikov=D>

I used your idea to write a tabchange listener which parsed the outline as you suggested.
However since the outline contain childnotes both at the root and at the root nodes,
I had to parse the children as well.

With a few tweaks to exclude tabs that didn't contain a representative menu option,
it works well.


Thanks

breck

Zakaroonikov
17 Dec 2009, 1:56 PM
I am glad it worked for your. Post the code (if you can). I think some people might find it very useful.