如何抑制jqgrid最初加载数据? [英] How to suppress jqgrid from initially loading data?

查看:97
本文介绍了如何抑制jqgrid最初加载数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在模式弹出窗口中有一个jqgrid,其数据取决于某些输入.我是通过根据如下所示的输入设置网格的url选项,然后显示弹出窗口来完成此操作的:

I have a jqgrid in a modal popup that has data dependent on some input. I am doing this by setting the url option of the grid based on the input like below then showing the popup:

$(ContainerGrid.Grid).setGridParam({
    url: urlGetContainers + '?CRALineId=' + currentCRALineId
}).reloadGrid();

第一次将网格加载到屏幕上时,直到显示模式弹出窗口时,才显示网格,并且不需要检索任何数据.不幸的是,jqgrid仍然尝试根据其url选项请求获取数据.

When the grid is first loaded on the screen, it isn't being displayed and no data needs to be retrieved until the modal popup is shown. Unfortunately, the jqgrid still tries to make a request to get data based on its url option.

我尝试过使用hiddengrid属性来最初隐藏/折叠网格,这也使它无法发出数据请求.但是,这没有用,因为我找不到以编程方式显示/扩展网格的方法.

I've tried using the hiddengrid property to hide/collapse the grid initially, which also keeps it from making a request for data. This didn't work, though, because I couldn't find a programmatic way show/expand the grid.

有什么方法可以抑制jqgrid最初加载数据吗?

Is there any way to suppress the jqgrid from initially loading data?

推荐答案

在模式弹出窗口的显示"事件中初始化网格.您可以动态生成jqGrid并将其插入到DOM中,然后使用常规的初始化代码后期绑定数据.

Initialize your grid in the 'Show' event of the modal popup. You can dynamically generate the jqGrid and insert it into the DOM, and then late-bind the data using the normal initialization code.

这篇关于如何抑制jqgrid最初加载数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆