Html 内容:
<dx:ASPxGridView ID="ASPxGridViewCluster" runat="server" Width="100%" ClientInstanceName="gridViewCluster" KeyFieldName="簇ID" OnCustomCallback="ASPxGridViewCluster_OnCustomCallback" OnPageIndexChanged="ASPxGridViewCluster_OnPageIndexChanged" OnBeforeColumnSortingGrouping="ASPxGridViewCluster_OnBeforeColumnSortingGrouping"> <Settings HorizontalScrollBarMode="Auto" VerticalScrollBarMode="Auto" VerticalScrollableHeight="200" ShowGroupPanel="False" ShowHeaderFilterButton="False"/> <SettingsPager AlwaysShowPager="true" PageSize="10"></SettingsPager> <SettingsBehavior AllowSelectByRowClick="True" AllowSelectSingleRowOnly="True" AllowSort="False"></SettingsBehavior> <ClientSideEvents RowDblClick="OnClusterGridDoubleClicked"/> <SettingsSearchPanel Visible="False"/> </dx:ASPxGridView>
JavaScript 内容
//获取grid选择的当前行的经纬度 function OnClusterGridDoubleClicked(s, e) { s.GetSelectedFieldValues("簇ID", GetClusterSelectedFieldValuesCallback); } //缩放地图到选择行的经纬度 function GetClusterSelectedFieldValuesCallback(values) { if (values.length === 0) { console.log("取得的值为空."); return; } var lll = values[0]; var id = lll[0]; setCookies("index_overview_grid_flag", 'cluster'); var title = "小区维度指标--簇ID:" + id; popCellPlan(title); }