function save(index) {
$("#gridlist").datagrid("endEdit", index);
var select = $("#gridlist").datagrid("getSelected");
var goodsId = select.GOODS_ID;
var lowerLimit = select.LOWER_LIMIT;
var storeInfoId = select.STORE_INFO_ID;
var param = {};
param.GOODS_ID = goodsId;
param.STORE_INFO_ID = storeInfoId;
param.LOWER_LIMIT = lowerLimit;
var url = "GoodsAction!modifyGoodsCordon.action";
if (isDigit(lowerLimit)) {
AjaxPost(url, param, function(data) {
$.alert("库存警戒线设置成功!");
});
} else {
$.alert("库存警戒线必须是数字!");
}
}
$(function() {
var p_height = $('.div_panel').parent().height();
$('.div_panel').height(p_height - 90);
$('.div_panel_search').height(75);
var grid = new easyui.datagrid(
……);
function ..①
};
我的问题是save()内部如何访问 方法①
jQuery
JavaScript
easyui
------解决方案--------------------
这样是访问不了的。
$(function() {
function save(index) {
$("#gridlist").datagrid("endEdit", index);
var select = $("#gridlist").datagrid("getSelected");
var goodsId = select.GOODS_ID;
var lowerLimit = select.LOWER_LIMIT;
var storeInfoId = select.STORE_INFO_ID;
var param = {};
param.GOODS_ID = goodsId;
param.STORE_INFO_ID = storeInfoId;
param.LOWER_LIMIT = lowerLimit;
var url = "GoodsAction!modifyGoodsCordon.action";
if (isDigit(lowerLimit)) {
AjaxPost(url, param, function(data) {
$.alert("库存警戒线设置成功!");
});
} else {
$.alert("库存警戒线必须是数字!");
}
}
window.save = save;
var p_height = $('.div_panel').parent().height();
$('.div_panel').height(p_height - 90);
$('.div_panel_search').height(75);
var grid = new easyui.datagrid(
……);
function ..①
};
要么把save放到里面来保持跟方法1在同一个作用域,要么把方法一提出去跟save保持在同一个作用域.
function save(index) {
$("#gridlist").datagrid("endEdit", index);
var select = $("#gridlist").datagrid("getSelected");
var goodsId = select.GOODS_ID;