У меня devexpress-gridview, в котором 2 столбца 1 показывает детали, а другой - значок удаления.Если я последовательно нажимаю значки удаления из 1-й строки, я получаю точное значение от GetVisibleRowsOnPage()
, но если я удаляю случайно, то я не получаю счет extact из вышеуказанной функции.Он остается постоянным
function CustomInsuranceButtonClick(s, e, gridObj, EGControlUI) {
$("#orderSummarybtnRefresh").css("display", "inline-block");
$("#orderSummaryWarning").css("display", "none");
var visibleRows = gridObj.GetVisibleRowsOnPage();
var flag = true;
if (visibleRows == 1 || (e.visibleIndex == -(visibleRows - 1))) {
flag = false;
return false;
}
if (flag) {
var row = gridObj.GetRow(e.visibleIndex);
var $div = row.cells[1].innerHTML
var lensOptionId = $($div).text();
if ($($div).text() == "") {
lensOptionId = $div;
}
$.ajax({
}
});
}
}
И код cshtml выглядит как
@Html.DevExpress().GridView(settings =>
{
settings.Name = string.Format("OpticalPlanDetails_{0}_EEG", ViewBag.EGControlUI);
settings.KeyFieldName = "RowGuid";
settings.EnableCallbackAnimation = false;
//settings.SettingsLoadingPanel.Mode = GridViewLoadingPanelMode.Disabled;
settings.SettingsPager.Mode = GridViewPagerMode.ShowAllRecords;
settings.SettingsSearchPanel.Visible = false;
settings.SettingsText.SearchPanelEditorNullText = "Search";
settings.Styles.SearchPanel.CssClass = "dxgvSearchPanel_Metropolis_Right";
settings.CommandColumn.VisibleIndex = 100;
settings.Settings.VerticalScrollBarMode = ScrollBarMode.Auto;
settings.Settings.VerticalScrollableHeight = 150;
settings.Width = Unit.Percentage(100);
settings.SettingsEditing.Mode = GridViewEditingMode.Inline;
settings.SettingsEditing.Mode = GridViewEditingMode.Batch;
settings.SettingsEditing.BatchEditSettings.StartEditAction =
GridViewBatchStartEditAction.Click;
settings.SettingsEditing.BatchEditSettings.EditMode = GridViewBatchEditMode.Row;
settings.SettingsEditing.NewItemRowPosition = GridViewNewItemRowPosition.Bottom;
settings.CommandColumn.ShowRecoverButton = false;
settings.SettingsEditing.BatchEditSettings.ShowConfirmOnLosingChanges = false;
settings.SettingsBehavior.AllowSelectByRowClick = true;
settings.Settings.ShowStatusBar = GridViewStatusBarMode.Hidden;
settings.CommandColumn.Visible = true;
settings.CommandColumn.Caption = " ";
settings.Styles.CommandColumnItem.CssClass = "glyphicon glyphicon-dustbin font17";
settings.CommandColumn.CustomButtons.Add(new
GridViewCommandColumnCustomButton() { ID = "btnGetKey", Text = " " });
settings.ClientSideEvents.CustomButtonClick =
string.Format("function(s, e) {{ CustomInsuranceButtonClick(s, e ," +
settings.Name + ",'" + ViewBag.EGControlUI + "'); }}");
settings.SettingsBehavior.AllowSort = false;
settings.SettingsBehavior.AllowDragDrop = false;
settings.SettingsText.EmptyDataRow = " ";
settings.SettingsBehavior.AllowEllipsisInText = false;
//settings.EditFormLayoutProperties.RequiredMarkDisplayMode =
FieldRequiredMarkMode.Hidden;
settings.CommandColumn.Visible = true;
settings.CommandColumn.Width = Unit.Pixel(15);
settings.Styles.Header.Border.BorderColor = System.Drawing.Color.Black;
settings.Styles.Footer.Border.BorderColor = System.Drawing.Color.Black;
Помогите мне получить точный счет из функции.это о devexpress gridView.