AspxGridView 客户端点击获取对应的列值
Posted 豆棚瓜架
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AspxGridView 客户端点击获取对应的列值相关的知识,希望对你有一定的参考价值。
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); }
以上是关于AspxGridView 客户端点击获取对应的列值的主要内容,如果未能解决你的问题,请参考以下文章