[Users] Radio Button in Sub-nodes (Treeview)...
Paul james
pauljame at gmail.com
Thu Oct 1 19:26:37 CEST 2009
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/20091001/6e79d9c3/attachment.htm
More information about the Users
mailing list