var url='../Apis/bNotice.aspx?actionName=Get&status=2&sid=' + Sys.sid;
var store = new Ext.data.Store({
autoDestroy: true,
autoLoad:true,
url:url,
reader: new Ext.data.JsonReader({
record: 'plant',
idProperty: 'ID',
root: 'rows',
totalProperty: 'results',
fields: [
{name:"ID",mapping:"ID"},
{ name: 'Title', mapping: 'Title' },
{name: 'Priority', mapping: 'Priority' },
{ name: "PublishDate", mapping: "PublishDate" },
{ name: "Content", mapping: "Content" }
]
})
});
//Ext.MessageBox.alert("11","11");
var grid = new Ext.grid.EditorGridPanel({
store: store,
cm: cm,
frame: true,
selModel: new Ext.grid.RowSelectionModel({ singleSelect: false }), //设置单行选中模式, 否则将无法删除数据
//clicksToEdit: 2,
loadMask: true,
tbar: [
{
text: '查询',
tooltip: 'Add a new row',
iconCls: "silk-add",
handler: function() {
searchWindow.show();
}
}]
});
//查询窗口
var searchWindow = new Ext.Window({
layout:'fit',
width:400,
height: 170,
modal:true,
closeAction:'hide',
title:"查询",
plain: true,
items:[{
id:"sw",
xtype:"form",
labelWidth: 100, // label settings here cascade unless overridden
//url: 'save-form.php',
frame: true,
//title: 'Simple Form',
bodyStyle: 'padding:5px 5px 0',
width: 350,
defaults: { width: 250 },
defaultType: 'textfield',
items: [{
fieldLabel: '标题',
name: 'Title',
id:'Title'
}]
}],
buttons: [{
text: '确 定',
handler:function(){
//alert("asdf");
var data = searchWindow.findById("sw").getForm().getValues();
//alert(data.FileNo);
searchWindow.hide();
searchWindow.findById("sw").getForm().reset();
store.load({
params: data //把整个表单当做参数来传,只需要在页面的.cs文件里面request["Title"]就能获取我将要搜索的关键字标题了
});
}
}, {
text: '取 消',
handler: function() {
searchWindow.hide();
}
}]
});
注意以上红字部分
- 本文标题: ExtJS 查询搜索功能传参问题与实现思路
- 文章分类:【JQuery/JavaScript】
- 非特殊说明,本文版权归【胡同里的砖头】个人博客 所有,转载请注明出处.