WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 Select xTree item based on its Text, Guilherme Blanco, August 9, 2003
     Re:Select xTree item based on its Text, Emil A Eklund, August 11, 2003
         Re:Select xTree item based on its Text, Guilherme Blanco, August 12, 2003
     Re:Select xTree item based on its Text, Erik Arvidsson, August 10, 2003

Subject: Re:Select xTree item based on its Text From: Emil A Eklund Date: August 11, 2003

Special chars are a bit, well, special ;)
Try to throw in an escape statement, it should help.

webFXTreeHandler.text[escape(this.text)] = this;

and then webFXTreeHandler.text[escape('some text')] to access it.

Also, as erik mentioned, make sure you check if you actually get an object back before trying to use it.



I build one update of xTree that I can select one item based on its Text.
It's working okay, if you plan to use it in some languages that doesn't have any special char (like English).

I made a few changes on it, it's working perfectly if you want to select a item that has spaces in its Text.

But, in my language I have special chars, like , , , , , and I can't use one item with "Pgina Inicial" (Main Page). I have to write "Página Inicial". If I try the first case, it works perfectly, but it doesn't appear the char in some computers. That's why I'm using á. But, if I try to select Página Principal, I get one error (line 9, char 9 -> 'parentNode' is null or it's not an object).

In my line 9, it's the function I made. Look:

function tree_reveal( oNode ) {
if( oNode.parentNode ) { // Line 9
tree_reveal( oNode.parentNode );
function tree_selectItemByText( sText ) {
var oNode = webFXTreeHandler.text[sText];
tree_reveal( oNode );

The changes I made are really simple. In the var webFXTreeHandler = {, I added the same code as all, so:

text: {},

In function WebFXTreeAbstractNode(sText, sAction) { :

webFXTreeHandler.text[this.text] = this;

In prototipe WebFXTreeItem.prototype._remove = function() { :

webFXTreeHandler.text[this.text] = null;

And all changes I need to do are done. They're almost the same as webFXTreeHandler.all code.
Try to do all these changes and test with special chars... it doesn't work.

I'm requesting some help if anyone can help me to solve it.

Guilherme Blanco


Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.

View All Messages
Back to WebFX