[Users] Radio Button in Sub-nodes (Treeview)...

Paul james pauljame at gmail.com
Fri Oct 2 16:44:05 CEST 2009


Update...
The problem was the Format.JSON().write function... It was not rendering the
baseAttrs method...
I put that inside
      root: {
            nodeType: "async",
            children:
...

And worked fine...

Thanks Andreas for the great help!

Paul

On Thu, Oct 1, 2009 at 2:26 PM, Paul james <pauljame at gmail.com> wrote:

> Thanks again Andreas...
> I tried that code (just added cb variable)...
> But the radio button never shows up... No javascript error reported as
> well... I think it is not entering in render function ...
> Any idea?
>
>   loader: {
>             param: "LAYERS",
>             baseAttrs: {
>                 uiProvider: Ext.extend(Ext.tree.TreeNodeUI, {
>                     render: function(bulkRender) {
>                         var cb = this.checkbox; //added
>                         Ext.tree.TreeNodeUI.prototype.render.apply(this,
> arguments);
>                         Ext.DomHelper.insertAfter(cb, '<input type="radio"
> class="gx-tree-radio" name="radio"></input>' );
>                     },
>                     onClick: function(e) {
>                         if(e.getTarget('.gx-tree-radio', 1)) {
>                             // do whatever you want to do when radio button
> was clicked
>                         }
>                         else {
>
> Ext.tree.TreeNodeUI.prototype.onClick.apply(this,arguments);
>                         }
>                     }
>                 })
>             }
>         }
>
> Paul
>
>   On Thu, Oct 1, 2009 at 5:35 AM, Andreas Hocevar <ahocevar at opengeo.org>wrote:
>
>> Hey Paul,
>>
>> in the simplest case, it would look something like this:
>>
>> nodeType: "gx_layer",
>> layer: "Tasmania (Group Layer)",
>> isLeaf: false,
>> loader: {
>>    param: "LAYERS",
>>    baseAttrs: {
>>        uiProvider: Ext.extend(Ext.tree.TreeNodeUI, {
>>            render: function(bulkRender) {
>>                Ext.tree.TreeNodeUI.prototype.render.apply(this,
>> arguments);
>>                Ext.DomHelper.insertAfter(cb,
>>                  '<input type="radio" class="gx-tree-radio"
>> name="radio"></input>'
>>                );
>>            },
>>            onClick: function(e) {
>>                if(e.getTarget('.gx-tree-radio', 1)) {
>>                    // do whatever you want to do when radio button was
>> clicked
>>                } else {
>>                     Ext.tree.TreeNodeUI.prototype.onClick.apply(this,
>> arguments);
>>                }
>>            }
>>        })
>>    }
>> }
>>
>> Regards,
>> Andreas.
>>
>> Paul james wrote:
>> > I was talking about that with Andreas :
>> >
>> > > What I tried to do :
>> > > 1-) Add radio button to Group Layer ...
>> > > nodeType: "gx_layer",
>> > >         layer: "Tasmania (Group Layer)",
>> > >         isLeaf: false,
>> > >         loader: {
>> > >             param: "LAYERS",
>> > >             baseAttrs: {radioGroup: "foo2"}
>> > >         }
>> > >
>> > > That doesnt work... Radio never shows up...
>> > Andreas Hocevar:
>> >
>> > > Yeah, because sub-nodes use a plain TreeNodeUI. If you want to use
>> these
>> > > additional radio buttons, you can try to configure the LayerParamNodes
>> > > with a LayerNodeUI. But I doubt that this will work out of the box.
>> > > Otherwise, it requires a custom UI. Patches for a generic
>> > > additional-radio-button-UI-mixin are welcome.
>> >
>> > Now, I悲 like help, and how can I do that custom UI... Any help will
>> > be great...
>> >
>> >
>> > Paul
>> > ------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > Users mailing list
>> > Users at geoext.org
>> > http://www.geoext.org/cgi-bin/mailman/listinfo/users
>> >
>>
>>
>> --
>> Andreas Hocevar
>> OpenGeo - http://opengeo.org/
>> Expert service straight from the developers.
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.geoext.org/pipermail/users/attachments/20091002/f0dc72f2/attachment.htm 


More information about the Users mailing list