Feb 08, 2013, 12:50 PM
[CLOSED] Linked dynamic searches in grid
I have two dynamic searches in a gridpanel. I want to pass the results from the first search into the second. I have created a BaseParam with a Raw value on the second search but please assist with JS syntax to read the data from the store from that specific record and pass it to the second dynamic search. Currently, it doesnt pass it properly. I also tried record.data.testLevelOneId and that didnt work. Maybe it doesnt work since combo isnt loaded yet?
Thanks,
/Z
Thanks,
/Z
<ext:Column ColumnID="testLevelOneId" Header="Group1" Width="120" DataIndex="testLevelOneId">
<Renderer Fn="testIdOneRenderer" />
<Editor>
<ext:ComboBox ID="ParentTestOneId"
runat="server"
Padding="5"
DisplayField="description"
TypeAhead="false"
ValueField="id"
LoadingText="Searching..."
EmptyText="Select an parent"
PageSize="10"
Width="300"
HideLabel="true"
HideTrigger="true"
ItemSelector="div.search-item"
MinChars="1" >
<Store>
<ext:Store ID="StoreTest_Combo" runat="server" AutoLoad="false">
<Proxy>
<ext:HttpProxy Method="GET" Url="/ta/Search/FindTests" />
</Proxy>
<Reader>
<ext:JsonReader Root="data" TotalProperty="total">
<Fields>
<ext:RecordField Name="id" Type="Int" />
<ext:RecordField Name="description" Type="String" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<Triggers>
<ext:FieldTrigger Icon="Clear" HideTrigger="true" />
</Triggers>
<Listeners>
<Select Handler="if (this.editable) { this.triggers[0].show(); } " />
<BeforeQuery Handler="this.triggers[0][ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
<TriggerClick Handler="if (index == 0) { this.clearValue(); this.triggers[0].hide(); }" />
</Listeners>
<Template ID="TemplateStoreTest" runat="server">
<Html>
<tpl for=".">
<div class="search-item">
<h3>{id}</h3>Description: {description}
</div>
</tpl>
</Html>
</Template>
</ext:ComboBox>
</Editor>
</ext:Column>
<ext:Column ColumnID="testLevelTwoId" Header="Group2" Width="120" DataIndex="testLevelTwoId">
<Renderer Fn="testIdTwoRenderer" />
<Editor>
<ext:ComboBox ID="ParentTestTwoId"
runat="server"
Padding="5"
DisplayField="description"
TypeAhead="false"
ValueField="id"
LoadingText="Searching..."
EmptyText="Select an parent"
PageSize="10"
Width="300"
HideLabel="true"
HideTrigger="true"
ItemSelector="div.search-item"
MinChars="1" >
<Store>
<ext:Store ID="StoreTestTwo_Combo" runat="server" AutoLoad="false">
<Proxy>
<ext:HttpProxy Method="GET" Url="/ta/Search/FindTests" />
</Proxy>
<BaseParams>
<ext:Parameter Name="parentId" Value="#{ParentTestOneId}.getValue()" Mode="Raw" />
</BaseParams>
<Reader>
<ext:JsonReader Root="data" TotalProperty="total">
<Fields>
<ext:RecordField Name="id" Type="Int" />
<ext:RecordField Name="description" Type="String" />
</Fields>
</ext:JsonReader>
</Reader>
</ext:Store>
</Store>
<Triggers>
<ext:FieldTrigger Icon="Clear" HideTrigger="true" />
</Triggers>
<Listeners>
<Select Handler="if (this.editable) { this.triggers[0].show(); } " />
<BeforeQuery Handler="this.triggers[0][ this.getRawValue().toString().length == 0 ? 'hide' : 'show']();" />
<TriggerClick Handler="if (index == 0) { this.clearValue(); this.triggers[0].hide(); }" />
</Listeners>
<Template ID="TemplateStoreTestTwo" runat="server">
<Html>
<tpl for=".">
<div class="search-item">
<h3>{id}</h3>Description: {description}
</div>
</tpl>
</Html>
</Template>
</ext:ComboBox>
</Editor>
</ext:Column>
Last edited by Daniil; Feb 14, 2013 at 4:46 AM.
Reason: [CLOSED]