[Users] Problem With GeoExt.tree.LayerContainer loader

Andrew Stewart Andrew.Stewart at reddeer.ca
Tue Nov 16 20:24:58 CET 2010


Ok figured it out, just had to modify the code to the following -

 if (record.data.title == 'Monday')
                    return true;



And it only returns the layer marked Monday now.
_____________________________________________
From:   Andrew Stewart
Sent:   November 16, 2010 12:07 PM
To:     users at geoext.org
Subject:        Problem With GeoExt.tree.LayerContainer loader

I am having a slight issue. What happens if you have 2 layers with similar names like one called Monday and the other called Monday Too. With my loader code below both layers would show up in my layertree evne though I only want the first one (Monday) to show, can it be modified so that it will match exact names of layers only? Appreciate any advice.

loader:
        {
            filter: function(record)
            {
                var myarr = new Array();
                myarr[0] = record.get("layer").name.indexOf("Monday");

                if(myarr[0]==-1)
                {
                return false;
                }
                else
                {
                return true;
                }
            }
            }
        });





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20101116/72bb6985/attachment.htm 


More information about the Users mailing list