access object from javascript DevExpress

做~自己de王妃 提交于 2019-12-11 16:26:15

问题


I wonder why I cant access Object by ClientInstanceName from javascript.

example:

function NextStep(pageControl) {
        currentStep = pageControl.GetActiveTabIndex();
        switch (currentStep) {
            case 0:
                selectedRowsCount = GridViewClient.GetSelectedRowCount();
break;
}

The error is:

There is no definition for GridViewClient;

but ClientInstanceName is set to GridViewClient

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().


回答1:


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.




回答2:


Have you set GridViewClient to disabled=true? As per this entry on the dx forums, this will result in no client-side object being created.




回答3:


I think that you are using the ASPxPageControl in a non client side mode. I.e. either AutoPostBack property is true or EnableCallbacks property is true. In this case, only the active tab page content is rendered and thus controls on inactive tabs are not available.



来源:https://stackoverflow.com/questions/3556307/access-object-from-javascript-devexpress

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!