extjs4.1 - Extjs 4.1 - How to work with UX Component Column -
i see tutorial @ http://skirtlesden.com/ux/component-column
and make demo project like
demo
|-index.html
|-component.js
|-ctemplate.js
here index.html
ext.loader.setconfig({enabled: true}); ext.require([ 'component' ]); ext.onready(function() { // create grid var grid = ext.create('ext.grid.panel', { title:'straw hats crew', width:500, height:180, striperows: true, renderto: ext.getbody(), store: ext.create('ext.data.arraystore', { fields: [ {name: 'name'} ], data: [ ['monkey d luffy'], ['roronoa zoro'], ['sanji'], ['usopp'], ['nami'] ] }), columns: [ { header: 'name', width: 100, dataindex: 'name', xtype: 'componentcolumn', renderer: function(name, meta, record) { return { value: name, xtype: 'textfield', listeners: { inputel: { keydown: function(ev) { ev.stoppropagation(); } } } }; } } ] }); });
my component.js
ext.define('skirtle.grid.column.component', { alias: 'widget.componentcolumn', extend: 'ext.grid.column.column', requires: ['ctemplate'], // modify ...
my ctemplate.js
ext.define('skirtle.ctemplate', { extend: 'ext.xtemplate', ....
but nothing working? how fix problem thanks
you need take @ page firebug , see scripts loaded. suspect may need set path component script in loader config. this:
ext.loader.setconfig({ enabled : true, paths: { 'ext.ux': 'js/extjs/ux', 'skirtle.grid.column.component':'js/extjs/ux/skirtlecomponentcolumn.js', 'skirtle.ctemplate' :'js/extjs/ux/skirtlectemplate.js' } }); ext.require([ 'skirtle.grid.column.component' ]);
modify path if see in firebug net tab tries load these files going wrong location resulting in 404.
Comments
Post a Comment