Jun 09, 2011, 3:17 PM
[CLOSED] gridpanel question
I am using a gridpanel and a triggerfield to perform a dynamic search facility, ie as you type in the triggerfield the contents of the grid update accordingly.
My question is this. I would like to highlight rows from the results in the gridpanel in response to UP/DOWN presses of the arrow keys in the triggerfield. then if the users hits enter select the highlighted row. But also retain the row select event in the gridpanel if the user clicks on a row using the mouse.
Is there a way of highlighting a row without the row select firing?
Or is there a way of using the existing 'select row' methods but without the select row event firing?
Remember I still want to retain the select event on mouse click.
On my page I have this grid panel:
Sean
My question is this. I would like to highlight rows from the results in the gridpanel in response to UP/DOWN presses of the arrow keys in the triggerfield. then if the users hits enter select the highlighted row. But also retain the row select event in the gridpanel if the user clicks on a row using the mouse.
Is there a way of highlighting a row without the row select firing?
Or is there a way of using the existing 'select row' methods but without the select row event firing?
Remember I still want to retain the select event on mouse click.
On my page I have this grid panel:
<ext:GridPanel HideHeaders="true" trackmouseover="true"
ID="grdQuickSearch"
runat="server" Width="190" Height="275"
AutoExpandColumn="colSearchItem">
<store>
<ext:Store runat="server" ID="strQuickSearch" AutoLoad="true" RemoteGroup="true" RemoteSort="true" RemotePaging="true" OnRefreshData="strQuickSearch_Refresh">
<AutoLoadParams>
<ext:Parameter Name="start" Value="0" Mode="Raw"></ext:Parameter>
<ext:Parameter Name="limit" Value="9" Mode="Raw"></ext:Parameter>
</AutoLoadParams>
<Proxy>
<ext:PageProxy />
</Proxy>
<Reader>
<ext:JsonReader IDProperty="DataIndex">
<Fields>
<ext:RecordField Name="DataIndex" Type="Int"></ext:RecordField>
<ext:RecordField Name="DataID" Type="Int"></ext:RecordField>
<ext:RecordField Name="DataTypeID" Type="Int"></ext:RecordField>
<ext:RecordField Name="DataName" Type="String"></ext:RecordField>
<ext:RecordField Name="DataTypeIcon" Type="String"></ext:RecordField>
<ext:RecordField Name="DataTitle" Type="String"></ext:RecordField>
</Fields>
</ext:JsonReader>
</Reader>
<Listeners>
<Load fn="defaultQuickSearchStoreLoaded" />
</Listeners>
</ext:Store>
</store>
<ColumnModel>
<Columns>
<ext:TemplateColumn ColumnID="colSearchItem" DataIndex="DataName" Header="">
<template runat="server" id="template4">
<Html>
<tpl for=".">
<table cellspacing="1" cellpadding="0">
<tr valign="middle">
<td width="16px"><image src="{DataTypeIcon}" height="16px" width="16px" /></td>
<td style="padding-left: 2px;">{DataName}</td>
</tr>
</table>
</tpl>
</Html>
</template>
</ext:TemplateColumn>
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" SingleSelect="true" >
<listeners>
<RowSelect Fn="defaultQuickSearchItemSelected" />
</listeners>
</ext:RowSelectionModel>
</SelectionModel>
<View>
<ext:GridView runat="server" EmptyText="Enter search criteria below"></ext:GridView>
</View>
<LoadMask ShowMask="true" />
<BottomBar>
<ext:PagingToolbar displaymsg="" AfterPageText="" beforepagetext="Page" emptymsg="" ID="pgrIndexGrid" runat="server" hiderefresh="true" PageSize="9" SkinID="none"></ext:PagingToolbar>
</BottomBar>
</ext:GridPanel>
and this trigger:<ext:TriggerField ID="trgQuickSearchFilter" enablekeyevents="true" runat="server" Width="190" EmptyText="Search MIS">
<Triggers>
<ext:FieldTrigger Icon="Search" HideTrigger="true" Qtip="Search" />
<ext:FieldTrigger Icon="Clear" HideTrigger="true" Qtip="Clear Search Results" />
</Triggers>
<Listeners>
<TriggerClick Handler="if (index === 1) { trigger.hide(); this.setValue(''); grdQuickSearch.store.reload({ params: { start: 0, limit: 9} }); } else { defaultQuickSearchTrigerClick(); }" />
<KeyUp Fn="defaultQuickSearchFilterKeyPress" />
<keydown Fn="defaultQuickSearchFilterStopBeep" />
<keypress Fn="defaultQuickSearchFilterStopBeep" />
</Listeners>
</ext:TriggerField>
Thanks.Sean
Last edited by Daniil; Jun 13, 2011 at 4:04 PM.
Reason: [CLOSED]