发表于: 2017-04-08 18:40:25

2 1506


今天完成的事情:完成文件搜索功能
明天计划的事情:完成图表展示的动态取数据
遇到的问题: 要区分正常查询和搜索查询,纠结很久,后来发现可以设置一个全局变量queryType,如果值为1,表示正常查询;2表示搜索查询。当做参数,传到后台进行判断。

var searchFileButton = Ext.create('Ext.button.Button',{

    text: '搜索',

    margin: '10 10 5 10',//(top, right, bottom, left)

    scope:this,

    handler: function() {

    queryType = 2; //表示搜索查询

    var keyword = searchTextField.getValue();

    Ext.apply(this.store.proxy.extraParams,{'keyword': keyword});

    Ext.apply(this.store.proxy.extraParams,{'queryType': queryType});

    this.store.load();

   }

    });

后台:

String queryType = request.getParameter("queryType");//1代表正常查找 2代表搜索查找

if(queryType.equals("2")){

searchFile();

}


收获:有了利用数字0 1 2 做标记的意识


返回列表 返回列表
评论

    分享到