Code:
<script type="text/javascript">
Ext.onReady(function(){
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
function change(val){
if(val > 0){
return '<span style="color:green;">' + val + '</span>';
}else if(val < 0){
return '<span style="color:red;">' + val + '</span>';
}
return val;
}
function pctChange(val){
if(val > 0){
return '<span style="color:green;">' + val + '%</span>';
}else if(val < 0){
return '<span style="color:red;">' + val + '%</span>';
}
return val;
}
var store = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({url:'php/JSONQS.php'}),
reader: new Ext.data.JsonReader({
root: 'customers',
totalProperty: 'total'
},
[
{name: 'select', type: 'string' , mapping: 'select'},
{name: 'quote', type: 'string' , mapping: 'quote'},
{name: 'sitesubmit', type: 'string' , mapping: 'sitesubmit'},
{name: 'customertype', type: 'string' , mapping: 'customertype'},
{name: 'timerecieved', type: 'date', dateFormat: 'n/j h:ia' , mapping: 'timerecieved'},
{name: 'phonenum', type: 'string' , mapping: 'phonenum'},
{name: 'email', type: 'string' , mapping: 'email'},
{name: 'flname', type: 'string' , mapping: 'flname'},
{name: 'delquote', type: 'string' , mapping: 'delquote'}
]
)
});
var quotessent = new Ext.grid.GridPanel({
ds: store,
sm: new Ext.grid.RowSelectionModel(),
columns: [
{header: "Select", width: 10 , sortable: true, dataIndex: 'select'},
{header: "Quote Number", width: 28 , sortable: true, dataIndex: 'quote'},
{header: "Website Sumbit", width: 16 , sortable: true, dataIndex: 'sitesubmit'},
{header: "Customer Type", width: 25 , sortable: true, dataIndex: 'customertype'},
{header: "Date Time Recieved", width: 15 , sortable: true, renderer: Ext.util.Format.dateRenderer('Y-m-d h:i:s a'), dataIndex: 'timerecieved'},
{header: "Phone Number", width: 25 , dataIndex: 'phonenum'},
{header: "Email Address", width: 35 , dataIndex: 'email'},
{header: "First / Last Name", width: 35 , dataIndex: 'flname'},
{header: "Admin Remove", width: 23 , dataIndex: 'delquote' ,cellActions:[{
iconIndex:'action1'
,qtipIndex:'qtip1'
,style:'background-color:#f0f0f0;'
}]}
],
stripeRows: true,
autoHeight: false,
viewConfig: {
forceFit: true
},
border: false,
bbar:[{
xtype:"button",
text:"Update Quote",
enableToggle: true
},{
xtype:"button",
text:"Email Quote",
enableToggle: true
},{
xtype:"button",
text:"Fax Quote",
enableToggle: true
}, '-', {
xtype:"button",
text:"Insert New Quote",
enableToggle: true
}, '-', {
xtype:"button",
text:"Clear Quote",
enableToggle: true
}]
,
plugins:[new Ext.ux.grid.Search({
mode:'local'
,iconCls:false
,dateFormat:'m/d/Y'
,minLength:2
,align:'right'
})]
});
var tabpanel = new Ext.TabPanel({
border:false,
activeTab:0,
tabPosition:'bottom',
items:[{
title: 'General Quotes',
//autoLoad:'quotesgeneral.php',
autoScroll:true
},{
title: 'Truckload Quotes',
//autoLoad: 'quotestruckload.php',
autoScroll:true
},{
title: 'General Requests',
autoScroll:true
},{
title: 'Residential Quotes Sent',
autoScroll:true
},{
title: 'Truckload Quotes Sent',
autoScroll:true
},{
title:"General Quotes Sent",
layout:"fit",
items: quotessent
}]
});
var viewport = new Ext.Viewport({
layout: 'border',
border: false,
header: false,
items:[
new Ext.BoxComponent({ // raw
region:'north',
el: 'north',
border: false,
header: false,
height:32
}), {
region:'south',
id:'south-panel',
title:'Quotes Select',
split:true,
height: 200,
minSize: 100,
maxSize: 210,
collapsible: true,
border:false,
margins:'0 0 0 5',
layout:'fit',
pressed:true,
items: tabpanel
},{
region:"west",
title:"Menubar",
width:125,
collapsible:true
},{
region:'center',
deferredRender:false,
autoScroll:true,
header: false,
border: false,
items:[{
title: 'Quote System',
header:true,
closable:false,
autoScroll:true
}]
}
]
});
store.load();
});
</script>
Im attempting to add this code oviously to where the rows are, at the end where it says Admin Remove. Would like to put 3 buttons there. But am so lost, that i cant even begin to figure out what im doing wrong lol, every time i try soemthing it throws an errror saying object is undefined. Thanks