用的技术是.net mvc,但界面设计使用ExtJS,用VS2008貌似都没有代码提示,也不会报错,求达人帮我查错<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
        <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link rel="stylesheet" type="text/css" href="../../ext/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="../../Content/css/icon.css" />
<title> </title>
<script type="text/javascript" src="../../ext/adapter/ext/ext-base.js">
</script>
<script type="text/javascript" src="../../ext/ext-all.js" charset = "gb2312">
</script>
<script type="text/javascript" >
Ext.onReady(function(){
    Ext.QuickTips.init();
    
    Ext.form.Field.prototype.msgTarge = 'side';
    
    var bd = Ext.getBody();
    
    var typeCmb = new Ext.form.ComboBox({
        triggerAction: "all",
        mode :"local",
        displayField:"type",
        emptyText:'请选择...',
        width:90,
        readOnly:true ,
        store:new Ext.data.SimpleStore({
                    readOnly:true,
                    data:["按领用审批单单号","按领用申请单状态"],
                    expandData:true,
                    fields:["type"]
        })
    });
    
    var typeCmb1 = new Ext.form.ComboBox({
        triggerAction: "all",
        mode :"local",
        displayField:"type",
        emptyText:'请选择...',
        width:120,
        readOnly:true ,
        store:new Ext.data.SimpleStore({
                    readOnly:true,
                    data:["按报废审批单单号","按报废申请单状态"],
                    expandData:true,
                    fields:["type"]
        })
    });
    
    
    var BorrowApplyInfo = Ext.data.Record.create([
                            {name:'bapp_id',type: 'string'},
                            {name:'reason',type: 'string'},
                            {name:'re',type: 'string'},
                            {name:'bapp_date',type: 'string'},
                            {name:'emp_name',type: 'string'},
                            {name:'apply_name',type: 'string'},
                            {name:'equ_type',type: 'string'},
                            {name:'apply_count',type: 'int'},
                            {name:'apply_price',type: 'int'},
                            {name:'sapp_state',type: 'char'}
    ]);
    
    var Borrowds = new Ext.data.Store({
        proxy: new Ext.data.HttpProxy({url: '/Comments/GetAllBorrowApplyInfo'}),
        reader: new Ext.data.JsonReader({
                totalProperty: "results",
                root : "BorrowApplyInfo"
            },BorrowApplyInfo)
    });
    Borrowds.on('beforeload',function(Borrowds) {
        Borrowds.baseParams = {bapp_id:null,sapp_state:null};
    });
    Borrowds.load({params:{start:0,limit:23}});
    
    var BorrowModel = new.Ext.grid.ColumnModel([
        {header: "领用申请单号", width: 75, sortable: true,dataIndex: 'bapp_id'},
        {header: "申请原因", width: 75, sortable: true,dataIndex: 'reason'},
        {header: "备注", width: 75, sortable: true,dataIndex: 're'},
        {header: "申请日期", width: 75, sortable: true,dataIndex: 'bapp_date'},
        {header: "申请员工名字", width: 75, sortable: true,dataIndex: 'emp_name'},
        {header: "申请设备", width: 75, sortable: true,dataIndex: 'apply_name'},
        {header: "型号", width: 75, sortable: true,dataIndex: 'equ_type'},
        {header: "申请数目", width: 75, sortable: true,dataIndex: 'apply_count'},
        {header: "估价", width: 75, sortable: true,dataIndex: 'apply_price'},
        {header: "申请单状态", width: 75, sortable: true,dataIndex: 'sapp_state'}
    ]);
    
    var ScrapApplyInfo = Ext.data.Record.create([
        {name:'sapp_id', type: 'string'},
        {name:'reason', type: 'string'},
        {name:'re', type: 'string'},
        {name:'sapp_date', type: 'string'},
        {name:'emp_name', type: 'string'},
        {name:'asset_id', type: 'string'},
        {name:'asset_name', type: 'string'},
        {name:'sapp_state', type: 'char'}
    ]);
    
    var Scrapds = new Ext.data.Store({
        proxy: new Ext.data.HttpProxy({url: 'Comments/GetAllScrapApplyInfo'}),
        reader: new Ext.data.JsonReader({
                totalProperty: "results",
                root : "ScrapApplyInfo"
            },ScrapApplyInfo)
    });
    
    Scrapds.on('beforeload', function(Scrapds) {
        Scrapds.baseParams = {sapp_id:null,sapp_state:null}
    } );
    Scrapds.load({params:{start:0,limit:12}});
    
    var ScrapModel = new Ext.grid.ColumnModel([
        {header: "报废申请单号", width: 75, sortable: true,dataIndex: 'sapp_id'},
        {header: "报废原因", width: 75, sortable: true,dataIndex: 'reason'},
        {header: "备注", width: 75, sortable: true,dataIndex: 're'},
        {header: "申请日期", width: 75, sortable: true,dataIndex: 'sapp_date'},
        {header: "申请人名字", width: 75, sortable: true,dataIndex: 'emp_name'},
        {header: "资产编号", width: 75, sortable: true,dataIndex: 'asset_id'},
        {header: "资产名称", width: 75, sortable: true,dataIndex: 'asset_name'},
        {header: "申请单状态", width: 75, sortable: true,dataIndex: 'sapp_state'}
    ]);
    

解决方案 »

  1.   

        var gridForm = new Ext.FormPanel({
            id: 'CommentsPanel',
            frame: true,
            labelAlign: 'left',
            title:"领用申请单及报废申请单内容查询",
            bodyStyle:'padding:5px',
            width: 700,
            autoHeight:true,
            waitMsgTarget: true,
            layout: 'fit',
            items: [{
                    xtype:'tabpanel',
                    activeTab: 0,
                    height:500,
                    plain:true,
                    defaults:{autoScroll: true},
                    items:[{
                        xtype:'panel',
                        title: '领用申请单',
                        iconCls:'gridpng',
                        id: 'Borrow-form',
                        frame: true,
                        bodyStyle:'padding:5px',
                        width: 760,
                        waitMsgTarget: true,
                        layout: 'column',  
                        items:[{      
                                items: [{
                                    columnWidth: 1,
                                    layout: 'fit',
                                    items: {
                                    xtype: 'grid',
                                    id: 'Borrowgrid',
                                    ds: Borrowds,
                                    cm: BorrowModel,
                                    sm: new Ext.grid.RowSelectionModel({
                        singleSelect:true
                            }),
                                    tbar:["选择查询类型",typeCmb,"",{
                                                xtype:'textfield',
                                                id:'searchtype',
                                                name:'searchtype'
                                            },{
                                                text:"查询",
                                                iconCls:'searchpng',
                                                handler:function(){
                                                    var _type = typeCmb.getValue() ;
                                                    if(document.getElementById("searchtype").value =="")
                                                        return
                                                if(_type == "按领用审批单单号"){
                                                     Borrowds.on('beforeload', function(Borrowds) { 
                                                            Borrowds.baseParams = {bapp_id: document.getElementById("searchtype").value};
                                                         });
                                                         Borrowds.load({params:{start:0,limit:23}});   
                                                    }
                                                    if(_type == "按领用申请单状态"){
                                                         Borrowds.on('beforeload', function(Borrowds) { 
                                                            Borrowds.baseParams = {bapp_id:null,sapp_state:document.getElementById("searchtype").value};
                                                         });
                                                         Borrowds.load({params:{start:0,limit:23}});   
                                                    }
                                                }
                                            },"-",{
                                                text:"查看全部",
                                                iconCls:'allpng',
                                                handler:function(){
                                                      Borrowds.on('beforeload', function(Borrowds) { 
                                                            Borrowds.baseParams = {bapp_id:null,sapp_state:null};
                                                      });
                                                      Borrowds.load({params:{start:0,limit:23}}); 
                                                }
                                            }],
                                        height: 450,
                                        border: true,
                                        bbar: new Ext.PagingToolbar({
                                            pageSize: 23,
                                            store: Borrowds,
                                            displayInfo: true,
                                            displayMsg: '显示第 {0} 条到 {1} 条记录,一共 {2} 条',
                                            emptyMsg: "没有记录",
                                            items:[{
                                                text:"刷新",
                                                handler:function(){
                                                    Borrowds.on('beforeload', function(Borrowds) { 
                                                        Borrowds.baseParams = {bapp_id:null,sapp_state:null};
                                                    } );
                                                    Borrowds.load({params:{start:0,limit:23}});
                                                }                   
                                            }]
                                        })
                                    }
                                    }]    
                        }]
                    },{
                        xtype:'panel',
                        title:"报废申请单",
                        iconCls:'gridpng',
                        id: 'scrap-form',
                        frame: true,
                        labelAlign: 'left',
                        bodyStyle:'padding:5px',
                        width: 760,        
                        layout: 'column',
                        items: [{
                            columnWidth: 1,
                            layout: 'fit',
                            items: {
                            xtype: 'grid',
                            id:'Scrapgrid',
                            ds: Scrapds,
                            cm: ScrapModel,
                            sm: new Ext.grid.RowSelectionModel({
                singleSelect:true
                    }),
                            height: 450,
                            border: true,
                            tbar:["选择查询类型",typeCmb1,"",{
                                                            xtype:'textfield',
                                                            name:'searchtype'
                                                        },{
                                                            text:"查询",
                                                            iconCls:'searchpng',
                                                            handler:function(){
                                                                if(document.getElementById("searchtype").value == "")
                                                                    return
                                                                var _type = typeCmb1.getValue() ;
                                                                if(_type == "按报废审批单单号"){
                                                                    Scrapds.on('beforeload', function(Scrapds) { 
                                                                        Scrapds.baseParams = {sapp_id: document.getElementById("searchtype").value,sapp_state:null};
                                                                    } );
                                                                    Scrapds.load({params:{start:0,limit:12}});
                                                                }
                                                                if(_type == "按报废申请单状态"){
                                                                    Scrapds.on('beforeload', function(Scrapds) { 
                                                                        Scrapds.baseParams = {sapp_id: null,sapp_state:document.getElementById("searchtype").value};
                                                                    } );
                                                                    Scrapds.load({params:{start:0,limit:12}});
                                                                }
                                                            }
                                                        },"-",{
                                                            text:"查看全部",
                                                            iconCls:'allpng',
                                                            handler:function(){
                                                                Scrapds.on('beforeload', function(Scrapds) { 
                                                                    Scrapds.baseParams = {sapp_id:null,sapp_state:null};
                                                                } );
                                                                Scrapds.load({params:{start:0,limit:12}});
                                                            }
                                   }],
                            bbar: new Ext.PagingToolbar({
                                    pageSize: 12,
                                    store: Scrapds,
                                    displayInfo: true,
                                    displayMsg: '显示第 {0} 条到 {1} 条记录,一共 {2} 条',
                                    emptyMsg: "没有记录",
                                    items:[{
                                        text:"刷新",
                                        handler:function(){
                                            Scrapds.on('beforeload', function(Scrapds) { 
                                                Scrapds.baseParams = {sapp_id:null,sapp_state:null};
                                            } );
                                            Scrapds.load({params:{start:0,limit:12}});
                                        }                   
                                    }]
                                })
                         }
                        }]
                    }]
            }],
            renderTo: bd
        })
    });
    </script>
    </head>
    <body>
        <div>
        
        </div>
    </body>
    </html>  
        
      

  2.   

    你得用fireBug去调试看看执行的情况,否则,就这样看很难看得出错在那里的。
      

  3.   


    大概看了一下  就这么多错误
    var BorrowModel = new.Ext.grid.ColumnModel([//new 后面的 '.'去掉
    var ScrapApplyInfo = Ext.data.Record.create([//加上 new 
    var gridForm = new Ext.FormPanel({//改成 new Ext.form.FormPanel
      

  4.   

    这么简单的问题 怎么不早点来问我啊不就是多了一个点号.你直接搜索"new.Ext"(没有引号),把里面的点号去掉就好
      

  5.   

    6楼的答案你先不要用.
    有问题的,1.var ScrapApplyInfo = Ext.data.Record.create([//加上 new 
    我认为不应该加new(实际是加与不加都可以)希望6楼出来讨论下2.var gridForm = new Ext.FormPanel({//改成 new Ext.form.Fo……
    Ext.form.FormPanel 可以简写成Ext.FormPanel
      

  6.   


    个人的写法而已,还是规范些,就好比
    var o={} 后面你可加";"也可以不加。
      

  7.   

    1.var ScrapApplyInfo = Ext.data.Record.create([//加上 new 
    我认为不应该加new(实际是加与不加都可以)这个不加new 不实例化你试试行吗?
      

  8.   

    现在遭遇的是后台的数据库数据好像没有通过JSON传递到EXT界面上,
    1.var ScrapApplyInfo = Ext.data.Record.create([//加上 new  
    这个有没有好像也没关系,因为我做其他的功能的时候实际上并没有用到new,但都实现了
      

  9.   


    那是你一直都错了,ScrapApplyInfo 这个是一个构造函数!!!(不管你加不加 new Ext都给你一个构造函数,而不是一个Object)你如果要加记录的时候是 new ScrapApplyInfo(....) 这样才产生一个实例你想想看,你不介意就加个好友,聊聊