grid.getView()。refreshNode():未定义视图

时间:2017-02-24 22:00:41

标签: javascript extjs

我正在处理现有代码,但收到错误:

  

未捕获参考错误:未定义视图

在这一行:

grid.getView().refreshNode(store.indexOfId(record.data.UserId));

任何人都可以告诉我哪里可能是错误以及我如何解决它? 我想要的只是更新网格的记录而不是整个网格

更多信息:

var grid= #{UsersGridPannel2};
var store = grid.getStore();
var recToUpdate = store.getById(record.data.UserId);

recToUpdate.set(record.getData());
recToUpdate.commit();                                    

grid.getView().refreshNode(store.indexOfId(record.data.UserId));

网格定义:

<ext:GridPanel runat="server" ID="UsersGridPannel2" AutoScroll="true" Width="1610" Height="550" EmptyText="No Users" >
                <Bin> 
                    <ext:Store runat="server" ID="storeUsersRoles" OnReadData="storeUsersRoles_ReadData">
                        <Model>
                            <ext:Model runat="server" IDProperty="RoleId" ID="UsersRoleModel1">
                                <Fields>
                                    <ext:ModelField Name="ApplicationId" />
                                    <ext:ModelField Name="RoleId" />
                                    <ext:ModelField Name="RoleName" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                    <ext:Store runat="server" ID="storeUsersSites" OnReadData="storeUsersSites_ReadData">
                        <Model>
                            <ext:Model runat="server" IDProperty="Siteid" ID="UsersSitesModel1">
                                <Fields>
                                    <ext:ModelField Name="Siteid" Type="Int" />
                                    <ext:ModelField Name="CTid" Type="Int" />
                                    <ext:ModelField Name="InstitutionId" Type="Int" />
                                    <ext:ModelField Name="clientid" Type="Int" />
                                    <ext:ModelField Name="Type" />
                                    <ext:ModelField Name="FullName" />
                                    <ext:ModelField Name="FullSiteName" />
                                </Fields>
                            </ext:Model>
                        </Model>
                    </ext:Store>
                </Bin>
.....

0 个答案:

没有答案