从javascript DevExpress访问对象 [英] access object from javascript DevExpress
问题描述
我想知道为什么我无法通过javascript通过ClientInstanceName访问对象。
I wonder why I cant access Object by ClientInstanceName from javascript.
示例:
function NextStep(pageControl) {
currentStep = pageControl.GetActiveTabIndex();
switch (currentStep) {
case 0:
selectedRowsCount = GridViewClient.GetSelectedRowCount();
break;
}
错误是:
没有GridViewClient的定义;
There is no definition for GridViewClient;
但是ClientInstanceName设置为GridViewClient
but ClientInstanceName is set to GridViewClient
在ASPxPageControl的其他选项卡上有thos网格,因此这些选项卡不可见,但是我想做的是在显示它之前刷新其中之一,并且我想使用客户端ASPxGridViewClient.Refresh()。
Case is that I have thos grid on other tabs in ASPxPageControl so that these aren't visible but What I want to do is to refresh one of it before displaying it and I wanted to use client side ASPxGridViewClient.Refresh().
推荐答案
这意味着,每次激活新选项卡时,ASPxPageControl都会向服务器发送回调。此回调对于获取活动选项卡的内容并将其显示在客户端上是必需的。因此,这种方法减少了将少量内容发送到客户端时加载页面所需的时间。请注意,如果EnableCallbacks设置为true,则ASPxPageControl会将其内容缓存在客户端。因此,当您激活已经处于活动状态的Tab时,不会发送回调,因此将使用纯客户端代码激活Tab。
This means that the ASPxPageControl sends a callback to the server every time you activate a new tab. This callback is necessary to obtain the content of the active tab and show it on the client. So, this approach reduces the time needed to load a page as a small content is sent to the client side. Note, that if the EnableCallbacks is set to true, the ASPxPageControl caches its contents on the client side. So, when you activate a Tab which was already active, a callback is not sent and thus tab is activated using the pure client side code.
这篇关于从javascript DevExpress访问对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!