+ -
当前位置:首页 → 问答吧 → extjs combobox如何向服务器传值

extjs combobox如何向服务器传值

时间:2011-03-09

来源:互联网

我是个combobox初学者我的代码如下JScript code
Ext.require([
    'Ext.form.ComboBox',
    'Ext.tip.QuickTips',
    'Ext.data.*'
]);
Ext.onReady(function() {
    Ext.tip.QuickTips.init();
    // Define the model for a State
    Ext.regModel('State', {
        fields: [
            {type: 'string', name: 'xh'},
            {type: 'string', name: 'xm'}
        ]
       
    });

    // The data for all states
   
    // The data store holding the states; shared by each of the ComboBox examples below
//    var store = new Ext.data.Store({
//        model: 'State',
//        data: states
//    });

    var comboxStore = new Ext.data.Store({ 
         model: 'State',         
         proxy: { 
             type:'ajax', 
              actionMethods: {
             create : 'POST',
             read   : 'POST',
             update : 'POST',
             destroy: 'POST'},
             url: "http://localhost:8080/cjcx/servlet/Getcj?Method=GetAllxhxm" , 
             reader:'json'         
         }, 
             atuoLoad:false            
         } ); 
//    comboxStore.load();

    // ComboBox with a custom item template
    var simple = new Ext.form.ComboBox({
        fieldLabel: '请输入您的姓名',
        renderTo: 'simple',
        displayField: 'xm',   
        valueField: 'name', 
//        hiddenValue:'xh',
//        hiddenField:'xh',
       // hiddenName:'empUserNum',
        allowBlank : false, 
        width: 500,
        labelWidth: 130,
        hideTrigger:true,
//        typeAhead:true,//延时查询,与下面的参数配合
//        typeAheadDelay:250,//默认250
         blankText:'输入姓名查询成绩',
         emptyText:'输入姓名查询成绩', 
         listEmptyText:'请仔细核对姓名信息',
         minChars : 1,          
         store:  comboxStore,
         query:'remote',   
         queryParam : 'empUserNum', 
//         hiddernName : 'empUserNum',        
         getInnerTpl: function() {
            return '<div ext:qtip="{xh}"> {xm}</div>';
            
       }
    });
  
     ////// Collapsible code panels; ignore: /////

    Ext.select('pre.code').each(function(pre) {
        new Ext.form.FieldSet({
            contentEl: pre,
            renderTo: pre.parent(),
            title: 'View code for this example',
            collapsible: true,
            collapsed: true
        })
    });

});



请问我怎么才能通过一个按钮把选中学生姓名时对应的学号传送到服务器端啊

作者: mail1239   发布时间: 2011-03-09

该回复于2011-03-10 09:02:09被管理员删除

  • 对我有用[0]
  • 丢个板砖[0]
  • 引用
  • 举报
  • 管理
  • TOP
#2楼 得分:0回复于:2011-03-10 09:34:11
JScript code

hiddenName: '**'


配置 hiddenName 属性

作者: y_h_t   发布时间: 2011-03-10

直接给参数就好了.

作者: dataminer_2007   发布时间: 2011-03-10

参数关键是不知道怎么写啊 请问有没有例子的代码啊 请问hiddenName:是怎么上传啊

作者: flyerwing   发布时间: 2011-03-10