[Users] Change Image Icon for layers nodes in TreePanel GeoExt 1.1
Bart van den Eijnden
bartvde at boundlessgeo.com
Thu Sep 11 20:11:44 CEST 2014
This is a lot of code to look at, but the answer is in there somewhere ;-)
https://github.com/boundlessgeo/gxp/blob/master/src/script/plugins/LayerTree.js
Specifically:
https://github.com/boundlessgeo/gxp/blob/master/src/script/plugins/LayerTree.js#L172
https://github.com/boundlessgeo/gxp/blob/master/src/script/plugins/LayerTree.js#L219:L221
Best regards,
Bart
Bart van den Eijnden
Front End Software Engineer | Boundless
bartvde at boundlessgeo.com
1-877-673-6436
@boundlessgeo
On 11 Sep 2014, at 20:06, Joaquin Carrasco Gallego <jcarrascog at gmail.com> wrote:
> Ok, Thanks for your help! I´ll keep trying it
>
>
> El 11/09/14 19:50, dustin.r.blankenship at accenturefederal.com escribió:
>> I'm not sure on different icons we haven't tried that new needed to remove them. I would guess there's a way to grab what's in there and evaluate. You would probably need to debug through the code.
>>
>> Dustin Blankenship
>> Sr. Software Developer
>> Accenture
>> 407 S Pennsylvania Ave
>> Joplin MO 64836
>> 417-793-3889
>>
>> Sent from my iPhone
>>
>> On Sep 11, 2014, at 12:38, "Joaquín Carrasco" <jcarrascog at gmail.com> wrote:
>>
>>> Thanks!! Does it show the same icon for all the nodes? would it be possible to show differente image for each node?
>>>
>>> Thanks again
>>>
>>> El 11/09/2014, a las 19:25, <dustin.r.blankenship at accenturefederal.com> escribió:
>>>
>>>> This is how we’ve done it:
>>>>
>>>> var layerTreeStore = Ext.create('Ext.data.TreeStore', {
>>>> model: 'GeoExt.data.LayerTreeModel',
>>>> root: {
>>>> expanded: true,
>>>> plugins: [{
>>>> ptype: 'gx_layercontainer',
>>>> loader: {
>>>> baseAttrs: {
>>>> iconCls: 'eventNodeIcon'
>>>> },
>>>> store: layerStore
>>>> }
>>>> }]
>>>> }
>>>> });
>>>>
>>>> Where the “eventNodeIcon” is a css class that uses a background image. For us it’s just blank.
>>>>
>>>> From: users-bounces at geoext.org [mailto:users-bounces at geoext.org] On Behalf Of dustin.r.blankenship at accenturefederal.com
>>>> Sent: Thursday, September 11, 2014 11:25 AM
>>>> To: jcarrascog at gmail.com
>>>> Cc: users at geoext.org
>>>> Subject: Re: [Users] Change Image Icon for layers nodes in TreePanel GeoExt 1.1
>>>>
>>>> We have done this I will get you a sample in an hour
>>>>
>>>> Dustin Blankenship
>>>> Sr. Software Developer
>>>> Accenture
>>>> 407 S Pennsylvania Ave
>>>> Joplin MO 64836
>>>> 417-793-3889
>>>>
>>>> Sent from my iPhone
>>>>
>>>> On Sep 11, 2014, at 11:23, "Joaquin Carrasco Gallego" <jcarrascog at gmail.com> wrote:
>>>>
>>>> Hi everyone, I am trying to change the image icon of a layer node in a
>>>> TreePanel but always shows me the default one of the class
>>>> ".x-tree-node-leaf .x-tree-node-icon". Searching for Internet in some
>>>> pages the createNode function is mention in a loader, but I am trying it
>>>> and it doesn´t works. Some help is appreciated. Here is my code:
>>>>
>>>>
>>>> var treeConfig = [ {
>>>> nodeType : "gx_baselayercontainer",
>>>> text : "Ortofotos"
>>>> }, {
>>>> nodeType : "gx_overlaylayercontainer",
>>>> text : "Capas Vectoriales",
>>>> expanded : true,
>>>> // render the nodes inside this container with a radio
>>>> button,
>>>> // and assign them the group "foo".
>>>> loader : {
>>>> baseAttrs : {
>>>> radioGroup : "foo",
>>>> uiProvider : "layernodeui",
>>>> },
>>>> createNode: function(attr) {
>>>> attr.iconCls = "nuevaClase";
>>>> return
>>>> GeoExt.tree.LayerParamLoader.prototype.createNode.apply(this, attr);
>>>> }
>>>> }
>>>> } ];
>>>>
>>>> Thanks!!!
>>>> _______________________________________________
>>>> Users mailing list
>>>> Users at geoext.org
>>>> http://www.geoext.org/cgi-bin/mailman/listinfo/users
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20140911/b3412853/attachment.htm
More information about the Users
mailing list