Feb 03, 2012, 3:33 AM
Adding row to grid in JS causes mouse tracking to fail with error
EXT.net 1.2
with grid below, add a record with grid.store.insert(0, record);
Move the mouse OVER the bottom row of the grid. a JS error is thrown. Since the grid
grew by 1 row, the triggerElement has a bug and did not recognize the new row and
therefore, we cannot find the row or the data and get an error
with grid below, add a record with grid.store.insert(0, record);
Move the mouse OVER the bottom row of the grid. a JS error is thrown. Since the grid
grew by 1 row, the triggerElement has a bug and did not recognize the new row and
therefore, we cannot find the row or the data and get an error
<script>
var showTip = function () {
var rowIndex = GridPanelT.view.findRowIndex(this.triggerElement),
cellIndex = GridPanelT.view.findCellIndex(this.triggerElement),
record = GridPanelT.store.getAt(rowIndex),
fieldName = GridPanelT.getColumnModel().getDataIndex(cellIndex),
data = record.get(fieldName);
this.body.dom.innerHTML = data;
};
</script>
<ext:GridPanel
ColumnLines="true"
ID="GridPanelT"
runat="server"
ClicksToEdit="1"
StripeRows="true"
TrackMouseOver="true"
Layout="fit"
Border="true"
AutoHeight="true">
<ColumnModel ID="ColumnModelT" runat="server">
<Columns>
<ext:Column Header="Id" ColumnID="id" DataIndex="id" Width="35" Hidden="true"/>
<ext:CommandColumn Width="24">
<Commands>
<ext:GridCommand CommandName="AddRow" Icon="Add">
<ToolTip Text="Add New Row" />
</ext:GridCommand>
</Commands>
</ext:CommandColumn>
<ext:DateColumn Header="Date" ColumnId="dateVate" Width="90" DataIndex="dateVate" Format="ddd MM/dd">
<Editor>
<ext:DateField ID="dateFieldDateVate" runat="server" />
</Editor>
</ext:DateColumn>
....
</ext:GridPanel>
<ext:ToolTip
ID="CellTip"
runat="server"
Target="={GridPanelT.getView().mainBody}"
Delegate=".x-grid3-cell"
TrackMouse="true">
<Listeners>
<Show Fn="showTip" />
</Listeners>
</ext:ToolTip>