I have a rather complex scenario.
I'm creating a set of coordinating User Controls that give me a tabbed interface where the tabs are Help, Search, Search Results, List, Edit, New, View, and some customizable functions. I'm turning these into a fully ajaxified interface controlled by instantiated JavaScript objects in an external JS file so that I can have multiple interfaces on the same page that use this interface. I have to say that this would be much, much more difficult without you guys at Telerik.
When I did this, I was able to instantiate a single interface on a page and it all worked perfectly. Very snappy response since it's all Ajaxified. So, for the next step, I took this interface and placed it in a RadWindow within a RadWindowManager so that I could utilize it in a desktop-like MDI interface like you have in the demos section. When I did this, things started to go funky. To start, I was getting postbacks on things like tab clicks, grid sorting and paging, and stuff like that. I also noticed that the counts in the RadGrid pager were messed up.
To address this, I'm taking a step at a time in order to focus on a single problem with minimal complexity.
I've been able to recreate a situation where I have a radGrid within a radWindow within a radWindowManager, and I'm ONLY calling set_virtualItemCount(5) in order to test updating the pager on the RadGrid. When I load this page, it shows 21 items in 2 pages. When I click the button to trigger the JavaScript, it remains at 21 items in 2 pages.
IF I REMOVE the RadWindowManager, and just have a standalone RadWindow, clicking the button changes the page count information to 5 items in 1 page. And, of course, if I take out the RadWindow as well, clicking the button changes the page count to 5 items in 1 page.
Can you figure out what's going on here?
Here's my code. It's all self-contained (no external JS file):
I'm hoping, of course, that this uncovers the root of all of my problems with this solution. I have to say that I don't have a 100% grasp on all of the details with the postbacks, but I clearly was able to reproduce this problem.
I've tested this in Firefox 4.01, IE 9 (using modes for IE 8 and IE 9), Chrome 12.0.742.91, and safari 5.0.5.
Thanks for your assistance.
I'm creating a set of coordinating User Controls that give me a tabbed interface where the tabs are Help, Search, Search Results, List, Edit, New, View, and some customizable functions. I'm turning these into a fully ajaxified interface controlled by instantiated JavaScript objects in an external JS file so that I can have multiple interfaces on the same page that use this interface. I have to say that this would be much, much more difficult without you guys at Telerik.
When I did this, I was able to instantiate a single interface on a page and it all worked perfectly. Very snappy response since it's all Ajaxified. So, for the next step, I took this interface and placed it in a RadWindow within a RadWindowManager so that I could utilize it in a desktop-like MDI interface like you have in the demos section. When I did this, things started to go funky. To start, I was getting postbacks on things like tab clicks, grid sorting and paging, and stuff like that. I also noticed that the counts in the RadGrid pager were messed up.
To address this, I'm taking a step at a time in order to focus on a single problem with minimal complexity.
I've been able to recreate a situation where I have a radGrid within a radWindow within a radWindowManager, and I'm ONLY calling set_virtualItemCount(5) in order to test updating the pager on the RadGrid. When I load this page, it shows 21 items in 2 pages. When I click the button to trigger the JavaScript, it remains at 21 items in 2 pages.
IF I REMOVE the RadWindowManager, and just have a standalone RadWindow, clicking the button changes the page count information to 5 items in 1 page. And, of course, if I take out the RadWindow as well, clicking the button changes the page count to 5 items in 1 page.
Can you figure out what's going on here?
Here's my code. It's all self-contained (no external JS file):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
lang
=
"en-us"
>
<
head
id
=
"Head1"
runat
=
"server"
>
<
meta
http-equiv
=
"Content-Language"
content
=
"en-us"
/>
<
meta
http-equiv
=
"Content-Type"
content
=
"text/html; charset=windows-1252"
/>
<
meta
http-equiv
=
"Content-Style-Type"
content
=
"text/css"
/>
<
meta
http-equiv
=
"Content-Script-Type"
content
=
"text/javascript"
/>
<
meta
name
=
"description"
id
=
"PageDescription"
runat
=
"server"
content
=
""
/>
<
meta
name
=
"keywords"
id
=
"PageKeywords"
runat
=
"server"
content
=
""
/>
<
title
>Untitled Page</
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
enableviewstate
=
"true"
method
=
"post"
>
<
telerik:RadScriptManager
runat
=
"server"
ID
=
"SM1"
>
<
Services
>
<
asp:ServiceReference
Path
=
"~/TestServices.asmx"
/>
</
Services
>
</
telerik:RadScriptManager
>
<
telerik:RadWindowManager
ShowOnTopWhenMaximized
=
"false"
Skin
=
"Web20"
Width
=
"590"
Height
=
"360"
Behaviors
=
"Close,Maximize,Minimize,Move,Reload,Resize"
ID
=
"RadWindowManager"
runat
=
"server"
EnableShadow
=
"true"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"VendorAdminWindow"
runat
=
"server"
VisibleOnPageLoad
=
"true"
ShowContentDuringLoad
=
"true"
DestroyOnClose
=
"false"
Skin
=
"Web20"
Width
=
"590"
>
<
ContentTemplate
>
<
asp:Button
ID
=
"Button1"
Text
=
"Load"
runat
=
"server"
OnClientClick
=
"return loadData()"
/>
<
Telerik:radGrid
ID
=
"ItemList"
runat
=
"server"
AllowPaging
=
"True"
PageSize
=
"20"
PagerStyle-AlwaysVisible
=
"true"
AllowSorting
=
"True"
HorizontalAlign
=
"NotSet"
AutoGenerateColumns
=
"False"
Skin
=
"WebBlue"
MasterTableView-Caption
=
"Right-Click a row to access the Context-Sensitive Menu, Click Column Names to Sort"
Width
=
"98%"
>
<
MasterTableView
ClientDataKeyNames
=
"ItemID_rin"
AllowMultiColumnSorting
=
"false"
>
<
Columns
>
<
Telerik:GridBoundColumn
DataField
=
"ItemID_rin"
UniqueName
=
"ItemID_rin"
visible
=
"false"
HeaderText
=
"Item ID"
/>
<
Telerik:GridBoundColumn
DataField
=
"FirstName_rst"
UniqueName
=
"FirstName_rst"
HeaderText
=
"First Name"
ItemStyle-VerticalAlign
=
"Top"
/>
<
Telerik:GridBoundColumn
DataField
=
"LastName_rst"
UniqueName
=
"LastName_rst"
HeaderText
=
"Last Name"
ItemStyle-VerticalAlign
=
"Top"
/>
<
Telerik:GridBoundColumn
DataField
=
"ForumHandle_rst"
UniqueName
=
"ForumHandle_rst"
HeaderText
=
"Handle"
ItemStyle-VerticalAlign
=
"Top"
/>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
>
<
Selecting
AllowRowSelect
=
"true"
/>
<
ClientEvents
OnCommand
=
"function(){}"
/>
</
ClientSettings
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
Position
=
"TopAndBottom"
/>
</
Telerik:radGrid
>
</
ContentTemplate
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
<
script
language
=
"javascript"
type
=
"text/javascript"
>
loadData = function () {
/********************************************************************************************\
|* *|
|* loadData *|
|* *|
\********************************************************************************************/
Grid_aob = $find('<%= ItemList.ClientID %>');
var tableView = Grid_aob.get_masterTableView();
tableView.clearSelectedItems();
tableView.set_virtualItemCount(5);
alert('Counts should be updated to 5 items.');
return false;
}
</
script
>
</
form
>
</
body
>
</
html
>
I'm hoping, of course, that this uncovers the root of all of my problems with this solution. I have to say that I don't have a 100% grasp on all of the details with the postbacks, but I clearly was able to reproduce this problem.
I've tested this in Firefox 4.01, IE 9 (using modes for IE 8 and IE 9), Chrome 12.0.742.91, and safari 5.0.5.
Thanks for your assistance.