PDA

View Full Version : [CLOSED] Migration From 1.x to 2.1 issues



imaa
Jan 20, 2013, 9:21 AM
Dear ,

I'm planning to migrate from EXT.net 1.x to 2.1 , but i'm facing many changes ,

the man change issue in store definition like in 2.1 using <Model> instead of <Reader>

i tried to replace all but always give me out of memory cause i have more than 500 pages .

could you please provide a simple plan to how to migrate it ..

Baidaly
Jan 20, 2013, 9:53 PM
Hello!

Please, read the following thread http://forums.ext.net/showthread.php?18358


i tried to replace all but always give me out of memory cause i have more than 500 pages .

Can you provide example of code which you want to migrate to Ext.NET 2.x?

imaa
Jan 21, 2013, 6:30 AM
Hello!

Please, read the following thread http://forums.ext.net/showthread.php?18358



Can you provide example of code which you want to migrate to Ext.NET 2.x?

its not problem to change the code but i need to see the break change from 1.x to 2.1 cause in this link
http://examples2.ext.net/#/Getting_Started/Release_Documents/BREAKING_CHANGES/

nothing about v 1.x .

i have more that 500 pages , so i want to make small program will modified the pages by one click cause it will be hard to change it one by one so i need to read all the changes that happen from ext 1.x to 2.0

Daniil
Jan 21, 2013, 7:21 AM
Hello,

We described as many breaking changes as we could. Unfortunately, we have no more option to migrate instead of the ones which are listed in the post that @Baidaly referred.

imaa
Jan 21, 2013, 12:09 PM
Dear,
we were using DirectEventConfig for store to show the event mask while it reading data in EXT.NET 1.2


<ext:Store ID="sOfferingSubject" runat="server" IDMode="Static" AutoDataBind="true"
AutoLoad="true" RemotePaging="true" OnRefreshData="sOfferingSubject_RefreshData">
<Proxy>
<ext:PageProxy />
</Proxy>
<Model>
<ext:Model runat="server" IDProperty="OfferingSubject_ID">
<Fields>
<ext:ModelField Name="OfferingSubject_ID" />
<ext:ModelField Name="Subject_ID" />
<ext:ModelField Name="Establesh_ID" />
<ext:ModelField Name="Collage_ID" />
<ext:ModelField Name="Institute_ID" />
<ext:ModelField Name="Department_ID" Type="Int" />
<ext:ModelField Name="Specialization_ID" Type="Int" />
<ext:ModelField Name="StudyPlan_ID" />
<ext:ModelField Name="Level" />
<ext:ModelField Name="Agenda_ID" />
<ext:ModelField Name="Semester_ID" />
<ext:ModelField Name="NumberOfOpenedClasses" />
<ext:ModelField Name="SubjecName" />
<ext:ModelField Name="DepartmentName" />
<ext:ModelField Name="InstitutesOrCollegeName" />
<ext:ModelField Name="SpecializationName" />
<ext:ModelField Name="EstableshType" />
<ext:ModelField Name="SubjectCoordinator_ID" />
<ext:ModelField Name="NumberOfLevels" />
<ext:ModelField Name="ActualHours" />
<ext:ModelField Name="EstablisheName" />
<ext:ModelField Name="NumberSymbole" />
<ext:ModelField Name="AgendYear">
<Convert Fn="curentStudyYearReset" />
</ext:ModelField>
</Fields>
</ext:Model>
</Model>
<DirectEventConfig>
<EventMask ShowMask="true" Msg="Loading Your Data " />
</DirectEventConfig>
<AutoLoadParams>
<ext:Parameter Name="start" Value="0" Mode="Raw" />
<ext:Parameter Name="limit" Value="5" Mode="Raw" />
</AutoLoadParams>
</ext:Store>



how this will be written in EXT.NET 2.1

Daniil
Jan 21, 2013, 12:23 PM
Thank you. We have just added a new breaking change item.

156. The Store's DirectEventConfig has been removed.

Use the PageProxy's RequestConfig property instead to apply required options for the actions which are done via a PageProxy.

If you use, for example, the GridPanel's submitData JavaScript method you might need to pass a respective config directly to this method as the second parameter.
http://examples2.ext.net/#/GridPanel/Miscellaneous/Export_Data_Ajax/

Example

grid.submitData(false, { isUpload: true });

imaa
Jan 21, 2013, 1:52 PM
Dear ,

Thanks for your fast replay ,

we used in EXT.net 1.2 in C# this method


ComboBox.SelectedItems.ValuesToJsonArray()


and now in 2.1 is gone , there is any solution for this

Best Regards

imaa
Jan 21, 2013, 2:46 PM
Dear Another Q,

we were using <ext:PageTreeLoader in tree panel loader , could u give me a sample example how to use it in EXT.NET 2.1



<ext:TreePanel ID="exampleTree" runat="server" Header="false" AutoScroll="true" Lines="false"
UseArrows="true" CollapseFirst="false" ContainerScroll="true" RootVisible="false">
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:TriggerField ID="TriggerField1" runat="server" EnableKeyEvents="true" Width="150"
EmptyText="البحث......">
<Triggers>
<ext:FieldTrigger Icon="Clear" HideTrigger="true" />
</Triggers>
<Listeners>
<KeyUp Fn="keyUp" Buffer="100" />
<TriggerClick Fn="clearFilter" />
<SpecialKey Fn="filterSpecialKey" />
</Listeners>
</ext:TriggerField>


<ext:Button ID="btnlock" IDMode="Static" runat="server" ToolTip="اقفال النظام" Icon="Lock">
<Listeners>
<Click Fn="Lockscreen" />
</Listeners>
</ext:Button>
<ext:Button ID="btnLogout" IDMode="Static" runat="server" ToolTip="تسجيل الخروج"
Icon="LockGo">
<Listeners>
<Click Fn="logOut" />
</Listeners>
</ext:Button>
<ext:Button ID="Button1" runat="server" Icon="Cog" ToolTip="Options">
<Menu>
<ext:Menu ID="Menu1" runat="server">
<Items>
<ext:MenuItem ID="MenuItem1" runat="server" Icon="SectionExpanded" Text="عرض الكل"
IconCls="icon-expand-all">
<Listeners>
<Click Handler="#{exampleTree}.root.expand(true);" />
</Listeners>
</ext:MenuItem>
<ext:MenuItem ID="MenuItem2" runat="server" Icon="SectionCollapsed" Text="اخفاء الكل"
IconCls="icon-collapse-all">
<Listeners>
<Click Handler="#{exampleTree}.root.collapse(true);" />
</Listeners>
</ext:MenuItem>
<ext:MenuItem ID="refreshitem" runat="server" Text="تحديث" Icon="Reload">
<Listeners>
<Click Fn="refreshMenu" />
</Listeners>
</ext:MenuItem>
<ext:MenuSeparator ID="MenuSeparator1" runat="server" />
<ext:MenuItem ID="MenuItem3" runat="server" Text="شكل النظام" Icon="Paintcan">
<Menu>
<ext:Menu ID="Menu2" runat="server">
<Items>
<ext:CheckMenuItem ID="CheckMenuItem1" runat="server" Text="ازرق سماوي" Group="theme"
Checked="true" />
<ext:CheckMenuItem ID="CheckMenuItem2" runat="server" Text="سكني" Group="theme" />
<ext:CheckMenuItem ID="MenuItem4" runat="server" Text="صخري" Group="theme" />
<ext:CheckMenuItem ID="CheckMenuItem3" runat="server" Text="غامق" Group="theme" />
</Items>
<Listeners>
<Click Fn="setTheme" />
</Listeners>
</ext:Menu>
</Menu>
</ext:MenuItem>
<ext:MenuSeparator ID="MenuSeparator2" runat="server" />
<ext:MenuItem ID="MenuItem5" runat="server" Text="اللغة" Icon="Paintcan">
<Menu>
<ext:Menu ID="Menu3" runat="server">
<Items>
<ext:CheckMenuItem ID="ar" runat="server" Text="عربي" Group="theme">
<DirectEvents>
<Click OnEvent="MenuItemSelected">
</Click>
</DirectEvents>
</ext:CheckMenuItem>
<ext:CheckMenuItem ID="en" runat="server" Text="English" Group="theme">
<DirectEvents>
<Click OnEvent="MenuItemSelected">
</Click>
</DirectEvents>
</ext:CheckMenuItem>
</Items>
</ext:Menu>
</Menu>
</ext:MenuItem>
</Items>
</ext:Menu>
</Menu>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Root>
<ext:Node Text="Examples" NodeID="root" Expanded="true">
<CustomAttributes>
<ext:ConfigItem Name="loaded" Value="false" Mode="Raw" />
</CustomAttributes>
</ext:Node>
</Root>

<Loader >
<ext:PageTreeLoader RequestMethod="GET" OnNodeLoad="LoadMainNode" PreloadChildren="true">
<EventMask ShowMask="true" Target="Parent" Msg="Loading..." />
<BaseAttributes>
<ext:Parameter Name="singleClickExpand" Value="true" Mode="Raw" />
<ext:Parameter Name="loaded" Value="true" Mode="Raw" />
</BaseAttributes>
</ext:PageTreeLoader>
</Loader>
<Listeners>
<ItemClick Handler="if (node.isLeaf()) { e.stopEvent(); loadExample(node.attributes.href, node.id, node.text); }" />
</Listeners>
</ext:TreePanel>

Daniil
Jan 21, 2013, 4:49 PM
Dear ,

Thanks for your fast replay ,

we used in EXT.net 1.2 in C# this method


ComboBox.SelectedItems.ValuesToJsonArray()


and now in 2.1 is gone , there is any solution for this

Best Regards

Please use this method.

ValuesToJsonArray

public string ValuesToJsonArray(Ext.Net.ListItemCollection list)
{
StringBuilder sb = new StringBuilder(128);
sb.Append("[");
bool needComma = false;

foreach (Ext.Net.ListItem item in list)
{
if (string.IsNullOrEmpty(item.Value))
{
continue;
}

if (needComma)
{
sb.Append(",");
}

sb.Append(JSON.Serialize(item.Value));

needComma = true;
}

sb.Append("]");

return sb.ToString();
}

Could you clarify why you need this method?

Daniil
Jan 21, 2013, 4:51 PM
Dear Another Q,

we were using <ext:PageTreeLoader in tree panel loader , could u give me a sample example how to use it in EXT.NET 2.1



<ext:TreePanel ID="exampleTree" runat="server" Header="false" AutoScroll="true" Lines="false"
UseArrows="true" CollapseFirst="false" ContainerScroll="true" RootVisible="false">
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:TriggerField ID="TriggerField1" runat="server" EnableKeyEvents="true" Width="150"
EmptyText="البحث......">
<Triggers>
<ext:FieldTrigger Icon="Clear" HideTrigger="true" />
</Triggers>
<Listeners>
<KeyUp Fn="keyUp" Buffer="100" />
<TriggerClick Fn="clearFilter" />
<SpecialKey Fn="filterSpecialKey" />
</Listeners>
</ext:TriggerField>


<ext:Button ID="btnlock" IDMode="Static" runat="server" ToolTip="اقفال النظام" Icon="Lock">
<Listeners>
<Click Fn="Lockscreen" />
</Listeners>
</ext:Button>
<ext:Button ID="btnLogout" IDMode="Static" runat="server" ToolTip="تسجيل الخروج"
Icon="LockGo">
<Listeners>
<Click Fn="logOut" />
</Listeners>
</ext:Button>
<ext:Button ID="Button1" runat="server" Icon="Cog" ToolTip="Options">
<Menu>
<ext:Menu ID="Menu1" runat="server">
<Items>
<ext:MenuItem ID="MenuItem1" runat="server" Icon="SectionExpanded" Text="عرض الكل"
IconCls="icon-expand-all">
<Listeners>
<Click Handler="#{exampleTree}.root.expand(true);" />
</Listeners>
</ext:MenuItem>
<ext:MenuItem ID="MenuItem2" runat="server" Icon="SectionCollapsed" Text="اخفاء الكل"
IconCls="icon-collapse-all">
<Listeners>
<Click Handler="#{exampleTree}.root.collapse(true);" />
</Listeners>
</ext:MenuItem>
<ext:MenuItem ID="refreshitem" runat="server" Text="تحديث" Icon="Reload">
<Listeners>
<Click Fn="refreshMenu" />
</Listeners>
</ext:MenuItem>
<ext:MenuSeparator ID="MenuSeparator1" runat="server" />
<ext:MenuItem ID="MenuItem3" runat="server" Text="شكل النظام" Icon="Paintcan">
<Menu>
<ext:Menu ID="Menu2" runat="server">
<Items>
<ext:CheckMenuItem ID="CheckMenuItem1" runat="server" Text="ازرق سماوي" Group="theme"
Checked="true" />
<ext:CheckMenuItem ID="CheckMenuItem2" runat="server" Text="سكني" Group="theme" />
<ext:CheckMenuItem ID="MenuItem4" runat="server" Text="صخري" Group="theme" />
<ext:CheckMenuItem ID="CheckMenuItem3" runat="server" Text="غامق" Group="theme" />
</Items>
<Listeners>
<Click Fn="setTheme" />
</Listeners>
</ext:Menu>
</Menu>
</ext:MenuItem>
<ext:MenuSeparator ID="MenuSeparator2" runat="server" />
<ext:MenuItem ID="MenuItem5" runat="server" Text="اللغة" Icon="Paintcan">
<Menu>
<ext:Menu ID="Menu3" runat="server">
<Items>
<ext:CheckMenuItem ID="ar" runat="server" Text="عربي" Group="theme">
<DirectEvents>
<Click OnEvent="MenuItemSelected">
</Click>
</DirectEvents>
</ext:CheckMenuItem>
<ext:CheckMenuItem ID="en" runat="server" Text="English" Group="theme">
<DirectEvents>
<Click OnEvent="MenuItemSelected">
</Click>
</DirectEvents>
</ext:CheckMenuItem>
</Items>
</ext:Menu>
</Menu>
</ext:MenuItem>
</Items>
</ext:Menu>
</Menu>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Root>
<ext:Node Text="Examples" NodeID="root" Expanded="true">
<CustomAttributes>
<ext:ConfigItem Name="loaded" Value="false" Mode="Raw" />
</CustomAttributes>
</ext:Node>
</Root>

<Loader >
<ext:PageTreeLoader RequestMethod="GET" OnNodeLoad="LoadMainNode" PreloadChildren="true">
<EventMask ShowMask="true" Target="Parent" Msg="Loading..." />
<BaseAttributes>
<ext:Parameter Name="singleClickExpand" Value="true" Mode="Raw" />
<ext:Parameter Name="loaded" Value="true" Mode="Raw" />
</BaseAttributes>
</ext:PageTreeLoader>
</Loader>
<Listeners>
<ItemClick Handler="if (node.isLeaf()) { e.stopEvent(); loadExample(node.attributes.href, node.id, node.text); }" />
</Listeners>
</ext:TreePanel>


Please see the following example.
http://examples2.ext.net/#/TreePanel/Loaders/Page/

By the way, it would be easy for us and you to keep one issue per a thread.