Widgets inside Dojo dgrid OnDemandList -


i'm trying similar this question using ondemandlist instead of ondemandgrid.

here have far

define([     "dojo/_base/declare",     "dijit/_widgetbase",     "dijit/_templatedmixin",     "dijit/_widgetsintemplatemixin",     "dgrid/ondemandlist",     "widget/categoryitem",     "dojo/dom-construct",     "dojo/text!./templates/category-list.html" ], function(declare, _widget, _templatedmixin, _widgetsintemplatemixin, ondemandlist, categoryitem, domconstruct, template) {     var catlist = declare([ondemandlist]);     return declare([_widget, _templatedmixin, _widgetsintemplatemixin], {         templatestring: template,         baseclass: "category-list",          postcreate: function() {             this.inherited(arguments);              // create ondemandlist, place in div defined in template.             var cat1 = this.cat1 = new catlist({                 store: this.store,                 renderrow: this.renderitem             }, this.categorieslevel0);          },          renderitem: function(item) {             return new categoryitem({                 title: item.title             });         }     }); }); 

the problem renderitems function needs somehow return dom containing custom widget. error error on domready callback: error: notfounderror: dom exception 8

yeah needs return dom node renderrow. assuming you're using _widgetbase categoryitem should work like:

renderitem: function(item) {     var category = new categoryitem({         title: item.title     });     return category.domnode; } 

the example here: https://github.com/sitepen/dgrid/wiki/ondemandlist-and-ondemandgrid pretty same thing, except uses put-selector, constructing div, attaching widget , returning new div.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -