-修正选中表格中不存在行时出错的问题(yygy-8066)。

This commit is contained in:
三生石上 2016-02-29 01:22:26 -05:00
parent 520d499353
commit 3c1d7c8fda
3 changed files with 24 additions and 3 deletions

View File

@ -161,6 +161,7 @@
<Content Include="test\activex.aspx" /> <Content Include="test\activex.aspx" />
<Content Include="test\form2.aspx" /> <Content Include="test\form2.aspx" />
<Content Include="test\grid_editor_cell2.aspx" /> <Content Include="test\grid_editor_cell2.aspx" />
<Content Include="test\hello.aspx" />
<Content Include="third-party\autocomplete\inline_window.aspx" /> <Content Include="third-party\autocomplete\inline_window.aspx" />
<Content Include="third-party\ckeditor\ckeditor.aspx" /> <Content Include="third-party\ckeditor\ckeditor.aspx" />
<Content Include="third-party\tinymce\tinymce.aspx" /> <Content Include="third-party\tinymce\tinymce.aspx" />
@ -1215,6 +1216,12 @@
<Compile Include="test\grid_editor_cell2.aspx.designer.cs"> <Compile Include="test\grid_editor_cell2.aspx.designer.cs">
<DependentUpon>grid_editor_cell2.aspx</DependentUpon> <DependentUpon>grid_editor_cell2.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="test\hello.aspx.cs">
<DependentUpon>hello.aspx</DependentUpon>
</Compile>
<Compile Include="test\hello.aspx.designer.cs">
<DependentUpon>hello.aspx</DependentUpon>
</Compile>
<Compile Include="third-party\autocomplete\inline_window.aspx.cs"> <Compile Include="third-party\autocomplete\inline_window.aspx.cs">
<DependentUpon>inline_window.aspx</DependentUpon> <DependentUpon>inline_window.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>

View File

@ -871,7 +871,11 @@ if (Ext.grid.Panel) {
sm.deselectAll(true); sm.deselectAll(true);
Ext.Array.each(rows, function (row, index) { Ext.Array.each(rows, function (row, index) {
// select( records, [keepExisting], [suppressEvent] ) // select( records, [keepExisting], [suppressEvent] )
sm.select(store.getById(row), true, true); // 有可能存在指定的行找不到的情况
var rowInstance = store.getById(row);
if (rowInstance) {
sm.select(rowInstance, true, true);
}
}); });
} }
}, },
@ -913,11 +917,15 @@ if (Ext.grid.Panel) {
cell = [rowId, columnId]; cell = [rowId, columnId];
} }
var sm = me.getSelectionModel(); if (cell && cell.length === 2) {
if (cell.length === 2) {
// 支持[行索引,列索引],也支持[行Id,列Id] // 支持[行索引,列索引],也支持[行Id,列Id]
var row = cell[0]; var row = cell[0];
var column = cell[1]; var column = cell[1];
// 如果未定义,则直接返回
if (!row || !column) {
return;
}
if(typeof(row) === 'string') { if(typeof(row) === 'string') {
row = me.f_getRow(row); row = me.f_getRow(row);
@ -927,6 +935,7 @@ if (Ext.grid.Panel) {
column = me.f_getColumn(column); column = me.f_getColumn(column);
} }
var sm = me.getSelectionModel();
sm.setCurrentPosition({ sm.setCurrentPosition({
row: row, row: row,
column: column column: column

View File

@ -29,6 +29,11 @@ FineUI 严格遵守 ExtJS 对开源软件的规定,不再内置 ExtJS 库,
发布历史 发布历史
+2016-05-** v4.2.4
-修正选中表格中不存在行时出错的问题yygy-8066
+2016-01-04 v4.2.3 +2016-01-04 v4.2.3
-修正表格后台无法更新选中行的问题丝路、black_shrimp-7649 -修正表格后台无法更新选中行的问题丝路、black_shrimp-7649
-更新表格控件->模板列->购物车示例,数量输入框只允许输入数字(揣兜-7654 -更新表格控件->模板列->购物车示例,数量输入框只允许输入数字(揣兜-7654