javascript - How to add widget to Dojo gridx/Grid header? -
i have gridx/grid (http://oria.github.io/gridx/) , want add together widgets in header cells textboxes, dropdowns etc. there way set widget in header cell?
it seems need module called headerregions
. here it's api . note add
, refresh
methods.
for simple illustration take here.
to impact 1 column header, utilize predicate on argument (column) provided callback first argument of add
(easiest utilize column id).
to insert widget, create programatically, fire it's startup
method , homecoming it's domnode
attribute.
(i not sure may startup
should called after grid rendered. may have maintain reference widget outside method)
for completeness, include of illustration linked above:
class="snippet-code-js lang-js prettyprint-override">deferred.when(parser.parse(), function() { var hr = grid1.headerregions; hr.add(function(col) { homecoming domconstruct.create('div', { style: 'height: 13px; width: 10px; background-color: red;' }); }, 0, 0); hr.add(function(col) { homecoming domconstruct.create('div', { style: 'height: 13px; width: 10px; background-color: green;' }); }, 1, 0); hr.refresh(); });
javascript dojo dojo.gridx
No comments:
Post a Comment