|
这是search.w页的搜索按钮
//搜索按钮单击事件
Model.prototype.searchBtnClick = function(event){
/*
1、获取搜索框值
2、存入data和缓存
3、打开 页面并传参
*/
var searchKeyData = this.comp("searchKeyData");
var text=this.comp("keyInput").val();
if(text.length>0 && searchKeyData.find(["key"],[text]).length==0){
var options = {
defaultValues : [ {
key : this.comp("keyInput").val()
} ]
};
searchKeyData.newData(options);
localStorage.setItem("search_input_keys",JSON.stringify(searchKeyData.toJson(true)));
}
justep.Shell.showPage("$UI/search/list.w?type=2",keyInput,{
keyValue : this.comp("keyInput").val()
});
这是list.w中的接收值:
Model.prototype.modelParamsReceive = function(event) {
/*
* 1、接收上页传来参数、显示在搜索框中、参数不变不刷新
*/
if (this.params != undefined) {
if (this.keyValue != this.params.keyValue) {
this.keyValue = this.params.keyValue;
this.comp("keyInput").val(this.keyValue);
this.comp("goodsData").refreshData();
}
}
}; |
|