PDA

View Full Version : Editable Grid Error.



primoshock
4 Feb 2008, 4:17 PM
I have been feverishly working to figure this out before I asked here,
but alas my sanity is dwindling, and I could really use some outside insight!
I cannot for the life of me get an editable grid to work . . .

It is inside a Window, which has tabs . . . I just want the calendar to pop
up, and it has before, but refuses to now . . . any suggestions.
Also, when I click on the menu I get tons of errors.

Thank you thank you thank you.

UPDATE:

Firebug gives the following error message:
this.selModel has no properties
Ext.grid.EditorGridPanel=Ext.extend(Ext.grid.GridPanel,{clicksToEdit:2,isEditor:...





var win = new Ext.Window({
title: 'Admin',
closable:true,
width:600,
height:350,
layout: 'border',
items: new Ext.TabPanel({
id: 'detailTabs',
region: 'center',
margins:'3 3 3 0',
tbar : new Ext.Toolbar({
items : [{
text: 'Become User',
iconCls: 'becomeuser',
handler: assumeUser
},
{
text:'User Status',
menu: activeMenu
}]
})
})
});

win.show(this);

var winTab = Ext.getCmp('detailTabs');


subscriptionDetails = new proSubscriptionDetails(pro_id);
winTab.add(subscriptionDetails.grid);
subscriptionDetails.ds.load({params:{start:0, limit:30}});

proSubscriptionDetails = function(pro_id){

var fm = Ext.form;
/* record object*/
var theRecord = Ext.data.Record.create([
{name: 'id'},
{name: 'sub_start'},
{name: 'sub_stop'},
{name: 'amount_paid'},
{name: 'plan_id'},
{name: 'response_code'},
{name: 'approval_code'},
{name: 'transaction_id'},
{name: 'cc_or_check'},
{name: 'promo_code'},
{name: 'insert_date'},
]);
/* parse JSON */
var parseJSON = new Ext.data.JsonReader({
root: 'results',
}, theRecord);

function formatDate(value){
return value;
};

/* data set */
var ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: '/ripcord/professionals/subscription_details.feed.php?id='+pro_id,
method: 'POST'
}),
reader: parseJSON
});

/* grid */
var grid = new Ext.grid.EditorGridPanel({
store: ds,
id:'subscription_grid',
title: 'Subscription Details',
width: '100%',
loadMask: true,
columns: [
{header: "ID", width: 50, dataIndex: 'id', sortable: true},
{header: "Start", width: 100, dataIndex: 'sub_start', sortable: true, editor: new Ext.form.DateField({format: 'm/d/y'})},
{header: "Stop", width: 100, dataIndex: 'sub_stop', sortable: true},
{header: "Amount Paid", width: 100, dataIndex: 'amount_paid', sortable: true},
{header: "Promo Code", width: 100, dataIndex: 'promo_code', sortable: true},
{header: "Transaction ID", width: 100, dataIndex: 'transaction_id', sortable: true},

]
});

this.ds = ds;
this.grid = grid;
}

4 Feb 2008, 6:06 PM
unrelated:
extra comma:


/* parse JSON */
var parseJSON = new Ext.data.JsonReader({
root: 'results',
}, theRecord)

...
/* grid */
var grid = new Ext.grid.EditorGridPanel({
store: ds,
id:'subscription_grid',
title: 'Subscription Details',
width: '100%',
loadMask: true,
columns: [
{header: "ID", width: 50, dataIndex: 'id', sortable: true},
{header: "Start", width: 100, dataIndex: 'sub_start', sortable: true, editor: new Ext.form.DateField({format: 'm/d/y'})},
{header: "Stop", width: 100, dataIndex: 'sub_stop', sortable: true},
{header: "Amount Paid", width: 100, dataIndex: 'amount_paid', sortable: true},
{header: "Promo Code", width: 100, dataIndex: 'promo_code', sortable: true},
{header: "Transaction ID", width: 100, dataIndex: 'transaction_id', sortable: true},

]
});



this will bite you in the ass when you test in ie :)

how is : subscriptionDetails = new proSubscriptionDetails(pro_id); going to work if you don't define it until later?