I have gridx/Grid (http://oria.github.io/gridx/) and I want to add some widgets in header cells like textboxes, dropdowns etc. Is there a way to put widget in header cell?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
Yes you can there is a plugin for the datagrid that you can add textbox and other input stuff within the layout. example of a layout
or this is more complete example
remember you need to add
dojo.require("dojox.grid.cells.dijit");
you can read about it here
UPDATE here is the gridx example
for more details have a read here
UPDATE2 Okay if I understand you correctly now when you create a gridx each layout name field will have the field name in it associated with grid- prefix so if the header you want to change is the
name
header you need use grid-prefix to replace the value or inject it with htmlIt seems that what you need is a module called
HeaderRegions
. Here is it's API . Especially note theadd
andrefresh
methods.For a simple example take a look here.
To affect only one column header, use a predicate on the argument (column) provided by the callback that is the first argument of
add
(easiest would be to use the column id).To insert a widget, create it programatically, fire it's
startup
method and return it'sdomNode
attribute.(I am not sure but it may be that
startup
should be called after the grid is rendered. For this you may have to keep a reference to the widget outside the method)For completeness, I include the some of the example linked above: