PDA

View Full Version : [CLOSED] Unable to get GridPanel Selected values



jesperhp
Jan 23, 2014, 7:37 AM
Hi
In Ext.Net Upgrade from v1.1 to v2.3 I am facing the issue, The is that I want to get just select row from dropdown field, in v1.1 I get the value from dropdown field like that ""[{\"ICategory\":1,\"Name\":\"KnowledgeBase\",\"ParentCategory\":\"\"}]""



<body>
<form runat="server">
<ext:ResourceManager runat="server" />


<ext:GridPanel
ID="GridPanel1"
runat="server"
StoreID="Store1"
Title="Export Data"
Width="600"
Height="350">
<TopBar>
<ext:Toolbar ID="toolbar_top" runat="server">
<Items>
<ext:Button ID="btn_KnowledgeBase_SaveandClose" runat="server" Text="<%$ Resources:HelpDeskWebApp,Add%>"
Icon="Disk" CausesValidation="true">
<DirectEvents>
<Click Json="true" Url="/KnowledgeBase/AddRecord" Type="Load" Method="POST" CleanRequest="true">
<ExtraParams>
<ext:Parameter Name="KnowledgeBaseID" Value="KnowledgeBase.getId()" Mode="Raw">
</ext:Parameter>
<ext:Parameter Name="subject" Value="#{txt_KnowledgeBase_Subject}.getValue()" Mode="Raw">
</ext:Parameter>
<ext:Parameter Name="keywords" Value="#{txt_KnowledgeBase_Keyword}.getValue()" Mode="Raw">
</ext:Parameter>
<ext:Parameter Name="ErrorCode" Value="#{spinner_KnowledgeBase_ErrorCode}.getValue()"
Mode="Raw">
</ext:Parameter>
<ext:Parameter Name="UserID" Value="#{cmb_KnowledgeBase_User}.getValue()" Mode="Raw">
</ext:Parameter>
<ext:Parameter Name="Problem" Value="#{txtProblem}.getValue()" Mode="Raw">
</ext:Parameter>
<ext:Parameter Name="Solution" Value="#{txtSolution}.getValue()" Mode="Raw">
</ext:Parameter>
<ext:Parameter Name="IsPublic" Value="#{chkboxIsPublic}.getValue()" Mode="Raw">
</ext:Parameter>
<ext:Parameter Name="CategoriesGrid" Value="Ext.encode(#{GridPanel_Categories}.getRowsValues({ selectedOnly:true}))"
Mode="Raw" Encode="true">
</ext:Parameter>
</ExtraParams>
</Click>
</DirectEvents>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
</ext:GridPanel>
</form>
</body>


and the dropdown field is like that



<ext:Panel ID="pnlCategories" runat="server" Title="Category"
Layout="VBoxLayout" Height="590px">
<LayoutConfig>
<ext:VBoxLayoutConfig Align="Stretch" />
</LayoutConfig>
<Items>
<ext:Panel ID="pnlCategoryCombo" runat="server" Layout="HBoxLayout" Height="40px"
Flex="1">
<LayoutConfig>
<ext:HBoxLayoutConfig Padding="10px" />
</LayoutConfig>
<Items>
<ext:DropDownField ID="cmb_KnowledgeBase_Category" runat="server" Width="350px" FieldLabel="<%$ Resources:HelpDeskWebApp,CategoryName%>"
Flex="1">
<Component>
<ext:TreePanel runat="server" Height="300" AutoScroll="true" EnableDD="false" ContainerScroll="true"
ID="tree_Location">
<Root>
<ext:Node NodeID="1" Text="<%$ Resources:HelpDeskWebApp,KnowledgeBase%>" />
</Root>
<Store>
<ext:TreeStore ID="TreeStore1" runat="server">
<Proxy>
<ext:AjaxProxy Json="true" Url="/KnowledgeBaseCategories/getNodes">
<ActionMethods Read="POST" />
</ext:AjaxProxy>
</Proxy>
</ext:TreeStore>
</Store>
<Listeners>
<ItemClick Handler="KnowledgeBase.setSelectedCategoryID(node.id);Knowl edgeBase._SelectedCategoryName=node.text;Knowledge Base.setSelectedCategoryParentName(node.id);#{cmb_ KnowledgeBase_Category}.setValue(KnowledgeBase.loc ationfullPath(record))" />
</Listeners>
</ext:TreePanel>
</Component>
</ext:DropDownField>
</Items>
</ext:Panel>
</Items>
</ext:Panel>
</Items>
</ext:Panel>


so please help me how to get selected row from extraparams on button click
Thanks

Daniil
Jan 23, 2014, 12:15 PM
Hi @jesperhp,

I am confused. There is "GridPanel Selected values" in the thread's title, but in the description you are talking about retrieving the values from the DropDownField.


in v1.1 I get the value from dropdown field like that ""[{\"ICategory\":1,\"Name\":\"KnowledgeBase\",\"Pare ntCategory\":\"\"}]""


Please clarify how do you get it? I don't see where you are retrieving the DropDownField's values in the ExtraParams section.

Also what are you getting in v2 instead?

A full test case is appreciated.

jesperhp
Jan 23, 2014, 2:31 PM
Hi @jesperhp,

I am confused. There is "GridPanel Selected values" in the thread's title, but in the description you are talking about retrieving the values from the DropDownField.


Please clarify how do you get it? I don't see where you are retrieving the DropDownField's values in the ExtraParams section.

Also what are you getting in v2 instead?

A full test case is appreciated.


Now getting empty list in v2.x,

but I want to get grid row selected value from dropdown

Now I am going to show image step by step
752575267527

please see the image which actually I want to get in v2.x
Image 3 show values after button click to server side ....

Thanks

Daniil
Jan 23, 2014, 4:00 PM
Are you saying that this returns nothing?

#{GridPanel_Categories}.getRowsValues({selectedOnl y:true})

Hmm, I don't see that any grid's row is selected. The "selectedOnly:true" option means that it retrieves selected rows only.

Also you should remove either Ext.encode() or Encode="true".

jesperhp
Jan 28, 2014, 2:13 PM
Are you saying that this returns nothing?

#{GridPanel_Categories}.getRowsValues({selectedOnl y:true})

Hmm, I don't see that any grid's row is selected. The "selectedOnly:true" option means that it retrieves selected rows only.

Also you should remove either Ext.encode() or Encode="true".

Thanks

please mark it close