Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.libraryListGrid = new Ext.grid.EditorGridPanel({
- clicksToEdit: 1,
- colModel: new Ext.grid.ColumnModel({
- columns: [
- {
- header: '',
- menuDisabled: true,
- width: 33,
- dataIndex: '',
- fixed: true,
- renderer: this.renderOrder
- },
- {
- menuDisabled: true,
- dataIndex: 'name',
- editable: !this.config.viewOnly,
- editor: new Ext.form.TextField({
- allowBlank: true,
- controllerThis: this,
- autoCreate: {tag: 'input', type: 'text', maxlength: '10'},
- listeners: {
- blur: function(item){
- var record = item.getValue();
- record = Ext.util.Format.htmlEncode(record);
- item.setValue(record);
- },
- render: function(cmp)
- {
- cmp.getEl().on('click',function(){
- this.dom.focus();
- });
- }
- }
- }),
- header: 'Library',
- id: 'name'
- },
- {
- header: '',
- menuDisabled: true,
- width: 35,
- dataIndex: '',
- fixed: true,
- renderer: this.renderActions
- }
- ]
- }),
- ds: this.libraryListDataStore,
- height: 200,
- width: 'auto',
- allowEdit: true,
- listeners: {
- rowclick: {
- fn: onRowClick,
- scope: this
- }
- },
- forceValidation: true,
- loadMask: true,
- renderTo: 'libraryListGrid',
- stripeRows: true,
- tbar: [{
- disabled: this.config.viewOnly,
- text: "Add ",
- icon: '/images/ext-gantt/add.png',
- handler : function(){
- // access the Record constructor through the grid's store
- var LibraryListSize = this.libraryListGrid.getStore().data.length;
- var Plant = this.libraryListGrid.getStore().recordType;
- var p = new Plant({
- });
- this.libraryListGrid.stopEditing();
- this.libraryListDataStore.insert(LibraryListSize, p);
- this.libraryListGrid.startEditing(LibraryListSize, 1);
- },
- scope: this
- }],
- view:this.view
- });
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement