Ext.onReady(function(){
Ext.QuickTips.init();
var fm = Ext.form,Ed = Ext.grid.GridEditor;
var sm = new Ext.grid.CheckboxSelectionModel();
var cm = new Ext.grid.ColumnModel({
columns: [
{
header: "Leaf Class",
dataIndex: 'partCat',
120,
align: 'left'
},{
header: "Shown on Drawing ?",
dataIndex: 'shownonDrawing',
160,
align: 'center',
editor: new Ed(new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
transform:'Drwaing',
lazyRender:true
}))
},{
header: "Drawing Number",
dataIndex: 'drawingNumber',
160,
align: 'center',
editor: new fm.TextField({
allowBlank: false,
allowNegative: false,
maxValue: 100000
})
}],
isCellEditable: function(col, row) {
var record = ds.getAt(row);
if (record.get('shownonDrawing') == 'Same As New Part') {
return false;
}
return Ext.grid.ColumnModel.prototype.isCellEditable.call(this, row, col);
}
});
// by default columns are sortable
cm.defaultSortable = true;
var Plant = Ext.data.Record.create([
{name: 'partCat'},
{name: 'shownonDrawing'},
{name: 'drawingNumber'}
]);
// create the Data Store
var ds = new Ext.data.Store({
url: 'PartAttributes.xml',
reader: new Ext.data.XmlReader({
record: 'partattrDesc'
}, Plant),
sortInfo:{field:'nounname', direction:'ASC'}
});
// create the editor grid
var griPI = new Ext.grid.EditorGridPanel({
ds: ds,
cm: cm,
sm: sm,
renderTo: 'partAttributes',
800,
height:400,
frame:true,
clicksToEdit:1,
tbar: [{
text: ' Save as Draft ',
iconCls: 'Save as Draft',
id: 'Save as Draft',
handler: function(){
}
},'-',{
text: ' Next ',
iconCls: 'Next',
id: 'Next',
handler: function(){
window.open("some.jsp","_self")
}
},'-',{
text: ' Cancel ',
iconCls: 'Cancel',
id: 'Cancel'
}
]
});
// trigger the data store load
ds.load();
});
Ext.QuickTips.init();
var fm = Ext.form,Ed = Ext.grid.GridEditor;
var sm = new Ext.grid.CheckboxSelectionModel();
var cm = new Ext.grid.ColumnModel({
columns: [
{
header: "Leaf Class",
dataIndex: 'partCat',
120,
align: 'left'
},{
header: "Shown on Drawing ?",
dataIndex: 'shownonDrawing',
160,
align: 'center',
editor: new Ed(new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
transform:'Drwaing',
lazyRender:true
}))
},{
header: "Drawing Number",
dataIndex: 'drawingNumber',
160,
align: 'center',
editor: new fm.TextField({
allowBlank: false,
allowNegative: false,
maxValue: 100000
})
}],
isCellEditable: function(col, row) {
var record = ds.getAt(row);
if (record.get('shownonDrawing') == 'Same As New Part') {
return false;
}
return Ext.grid.ColumnModel.prototype.isCellEditable.call(this, row, col);
}
});
// by default columns are sortable
cm.defaultSortable = true;
var Plant = Ext.data.Record.create([
{name: 'partCat'},
{name: 'shownonDrawing'},
{name: 'drawingNumber'}
]);
// create the Data Store
var ds = new Ext.data.Store({
url: 'PartAttributes.xml',
reader: new Ext.data.XmlReader({
record: 'partattrDesc'
}, Plant),
sortInfo:{field:'nounname', direction:'ASC'}
});
// create the editor grid
var griPI = new Ext.grid.EditorGridPanel({
ds: ds,
cm: cm,
sm: sm,
renderTo: 'partAttributes',
800,
height:400,
frame:true,
clicksToEdit:1,
tbar: [{
text: ' Save as Draft ',
iconCls: 'Save as Draft',
id: 'Save as Draft',
handler: function(){
}
},'-',{
text: ' Next ',
iconCls: 'Next',
id: 'Next',
handler: function(){
window.open("some.jsp","_self")
}
},'-',{
text: ' Cancel ',
iconCls: 'Cancel',
id: 'Cancel'
}
]
});
// trigger the data store load
ds.load();
});