Skip to content

Commit 4c2b051

Browse files
committed
fix col index condition
1 parent 51914a3 commit 4c2b051

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

ASP.NET Core/Views/Home/Index.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
else if (e.fullName.includes("sortOrder")) {
7979
const match = e.fullName.match(/\[(\d+)\]/);
8080
const colIdx = match ? parseInt(match[1], 10) : null;
81-
if (colIdx) {
81+
if (colIdx !== null) {
8282
const dataField = e.component.columnOption(colIdx, 'dataField');
8383
dataGridDependent.beginUpdate();
8484
if (prevColSorted && prevColSorted !== dataField) {
@@ -94,7 +94,7 @@
9494
if (opt) {
9595
const match = e.fullName.match(/\[(\d+)\]/);
9696
const colIdx = match ? parseInt(match[1], 10) : null;
97-
if (colIdx) {
97+
if (colIdx !== null) {
9898
dataField = e.component.columnOption(colIdx, 'dataField');
9999
dataGridDependent.columnOption(dataField, opt, e.value);
100100
}

Angular/src/app/app.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class AppComponent {
4141
if (e.fullName.includes('sortOrder')) {
4242
const match = /\[(\d+)\]/.exec(e.fullName);
4343
const colIdx = match ? parseInt(match[1], 10) : null;
44-
if (colIdx) {
44+
if (colIdx !== null) {
4545
const dataField = e.component.columnOption(colIdx, 'dataField');
4646
this.dependentGrid.instance.clearSorting();
4747
this.columnSortOpts = {};

jQuery/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ $(() => {
1818
} else if (e.fullName.includes('sortOrder')) {
1919
const match = e.fullName.match(/\[(\d+)\]/);
2020
const colIdx = match ? parseInt(match[1], 10) : null;
21-
if (colIdx) {
21+
if (colIdx !== null) {
2222
const dataField = e.component.columnOption(colIdx, 'dataField');
2323
dataGridDependent.beginUpdate();
2424
if (prevColSorted && prevColSorted !== dataField) {
@@ -34,7 +34,7 @@ $(() => {
3434
if (opt) {
3535
const match = e.fullName.match(/\[(\d+)\]/);
3636
const colIdx = match ? parseInt(match[1], 10) : null;
37-
if (colIdx) {
37+
if (colIdx !== null) {
3838
dataField = e.component.columnOption(colIdx, 'dataField');
3939
dataGridDependent.columnOption(dataField, opt, e.value);
4040
}

0 commit comments

Comments
 (0)