ExtJs4 Grid 报错 --缺少分号 跪求帮助

esft 2011-10-08 11:37:07
网页错误详细信息

用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; Trident/4.0; .NET CLR 1.1.4322; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; CIBA)
时间戳: Sat, 8 Oct 2011 03:43:37 UTC


消息: 缺少 ';'
行: 1
字符: 19
代码: 0
URI: http://localhost:2218/Business/PlaceOrderGridService.aspx?_dc=1318045367768&page=1&start=0&limit=50&callback=Ext.data.JsonP.callback1



js代码:

Ext.require([
'Ext.panel.*',
'Ext.toolbar.*',
'Ext.button.*',
'Ext.container.ButtonGroup',
'Ext.layout.container.Table'
]);

Ext.onReady(function () {
Ext.QuickTips.init();
//创建布局
createViewPortSearch();
});

function createViewPortSearch() {
Ext.create('Ext.container.Viewport',{
layout:'border',
renderTo:Ext.getBody(),
items:[
{
id:'north',
region:'north',
xtype:'panel',
collapsible:true,
height:125,
autoHeight:false,
border:false,
items:
searchForm,
margins:'0 0 5 0'//上左下右
},
{
id:'center',
region:'center',
xtype:'panel',
items:grid
}
]
});
}

Ext.define('ForumThread', {
extend: 'Ext.data.Model',
fields: [
'ManufactureOrder', 'SaleOrder',
{name: 'Salesman', type: 'string'},
{name: 'OrderType', mapping: 'OrderType', type: 'string'}
],
idProperty: 'threadid'
});

var store = Ext.create('Ext.data.Store', {
pageSize: 50,
model: 'ForumThread',
// fields: ['ManufactureOrder', 'SaleOrder', 'Salesman', 'OrderType'],
// remoteSort: true,
proxy: {
type: 'jsonp',
url: '/Business/PlaceOrderGridService.aspx',
//type: 'memory',
// data:{totalCount:2,'data':[{ManufactureOrder:'fdsf',SaleOrder:'fds',Salesman:'1',OrderType:'',OrderDate:'2011-01-01 0:00:00',ProductType:'',BillingInstruction:'fds',SMTProcessModuleCode1:'',SMTProcessModuleCode2:'',SMTProcessModuleCode3:'',SMTProcessModuleCode4:'',FittingProcessModuleCode:'',PackingProcessModuleCode:'',FactoryModel:'fds',MarketUseName:'',PackingType:'',SchemeName:'',LogoName:'',CustomerName:'',OrderAmount:'',PMCReviewDeliverDate:'',NakedMachineAmount:'',NakedMachineManufactureType:'',Remark:''},{ManufactureOrder:'test',SaleOrder:'1',Salesman:'1',OrderType:'',OrderDate:'2011-01-01 0:00:00',ProductType:'',BillingInstruction:'',SMTProcessModuleCode1:'',SMTProcessModuleCode2:'',SMTProcessModuleCode3:'',SMTProcessModuleCode4:'',FittingProcessModuleCode:'',PackingProcessModuleCode:'',FactoryModel:'',MarketUseName:'',PackingType:'',SchemeName:'',LogoName:'',CustomerName:'',OrderAmount:'',PMCReviewDeliverDate:'',NakedMachineAmount:'',NakedMachineManufactureType:'',Remark:''}]},
reader: {
root: 'data',
totalProperty: 'totalCount'
},
// sends single sort as multi parameter
simpleSortMode: true
// model:{
// idProperty: 'threadid',
// fields: [
// 'ManufactureOrder', 'SaleOrder', 'Salesman','OrderType'
// ]
// }
}
// ,sorters: [{
// property: 'lastpost',
// direction: 'DESC'
// }]
});
store.loadPage(1);

var searchForm = Ext.create('Ext.form.Panel', {
renderTo: Ext.getCmp('north'),
method:'POST',
//title: '下单统计表',
bodyStyle: 'padding:5px 5px 0;width:80%',
autoWidth:true,
fieldDefaults: {
labelAlign: 'left',
msgTarget: 'side'
},
defaults: {
border: false,
xtype: 'panel',
flex: 1,
layout: 'anchor'
},
layout: 'hbox',
items: [{
items: [{
xtype:'textfield',
fieldLabel: '销售订单号',
anchor: '80%',
name: 'SaleOrder',
id:'SaleOrder'
}]
}]
});

var grid = Ext.create('Ext.grid.Panel', {
width: 700,
height: 500,
// title: 'ExtJS.com - Browse Forums',
store: store,
// disableSelection: true,
// loadMask: true,
// viewConfig: {
// id: 'gv',
// trackOver: false,
// stripeRows: false,
// plugins: [{
// ptype: 'preview',
// bodyField: 'excerpt',
// expanded: true,
// pluginId: 'preview'
// }]
// },
columns:[
{
id: 'ManufactureOrder',
text: "生产订单号",
dataIndex: 'ManufactureOrder',
flex: 1,
// renderer: renderTopic,
sortable: false
},{
text: "销售订单号",
dataIndex: 'SaleOrder',
width: 100,
// hidden: true,
sortable: true
},{
text: "业务员",
dataIndex: 'Salesman',
width: 70,
align: 'right',
sortable: true
},{
id: 'OrderType',
text: "订单类型",
dataIndex: 'OrderType',
width: 150,
// renderer: renderLast,
sortable: true
}
// {
// header: '母件编码',
// dataIndex: 'cInvCode',
// width: 150
// },
// {
// header: '版本号',
// dataIndex: 'Version',
// width: 80
// }
],
// paging bar on the bottom
bbar: Ext.create('Ext.PagingToolbar', {
store: store,
displayInfo: true,
displayMsg: 'Displaying topics {0} - {1} of {2}',
emptyMsg: "No topics to display",
items:[
'-', {
text: 'Show Preview'
// pressed: pluginExpanded,
// enableToggle: true,
// toggleHandler: function(btn, pressed) {
// var preview = Ext.getCmp('gv').getPlugin('preview');
// preview.toggleExpanded(pressed);
// }
}]
})
// renderTo: 'topic-grid'
});
...全文
249 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
esft 2011-10-12
  • 打赏
  • 举报
回复
最后解决了
把proxy换成httpproxy
baiuwl 2011-10-11
  • 打赏
  • 举报
回复
ExtJs4是包里面少分号,不是程序的问题。
豆虫 2011-10-08
  • 打赏
  • 举报
回复
大眼看上去 貌似都没什么问题
createViewPortSearch这个function放到最后去 里边的items:searchForm
你把这个变量定义在后边了

找不出原因 就firebug跟一下吧 最笨的办法打打alert看一下到哪挂掉了
esft 2011-10-08
  • 打赏
  • 举报
回复
调不出来错误~~~
求救啊·~~~
help~~
sos~~~
esft 2011-10-08
  • 打赏
  • 举报
回复
网上有帖子好像说是乱码问题?
不晓得怎么办了
求HELP~~
esft 2011-10-08
  • 打赏
  • 举报
回复
照楼上大大说的把createViewPortSearch这个function放到最后了,还是不行
可是好像问题不在这里。最终grid的框框已经出来了,就是卡在读取数据的loading画面。
js提示错误:缺少分号

87,910

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧