Skip to content

Commit d503d3e

Browse files
committed
chore: sync grid xplat samples remove of forceUpdate
1 parent 41d9375 commit d503d3e

File tree

4 files changed

+35
-46
lines changed
  • samples/grids
    • grid
    • hierarchical-grid/multi-column-headers-template/src
    • tree-grid/multi-column-headers-template/src

4 files changed

+35
-46
lines changed

samples/grids/grid/binding-composite-data/src/index.tsx

+35-43
Original file line numberDiff line numberDiff line change
@@ -125,26 +125,22 @@ export default class Sample extends React.Component<any, any> {
125125
return (
126126
<>
127127
<div className="contact-container--edit" style={{padding: "1rem"}}>
128-
<IgrInput label='Name' onInput={(e: any) =>
129-
{
130-
cell.row.data.ContactName = e.detail;
131-
grid.forceUpdate();
132-
}
133-
} value={cell.row.data.ContactName}></IgrInput>
134-
<IgrInput label='Title' onInput={(e: any) =>
135-
{
136-
cell.row.data.ContactTitle = e.detail;
137-
grid.forceUpdate();
138-
}
139-
} value={cell.row.data.ContactTitle}></IgrInput>
140-
<IgrInput label='Company' onInput={(e: any) =>
141-
{
142-
cell.row.data.Company = e.detail;
143-
grid.forceUpdate();
144-
}
145-
} value={cell.row.data.Company}></IgrInput>
128+
<IgrInput
129+
label='Name'
130+
onInput={(e: any) => cell.row.data.ContactName = e.detail}
131+
value={cell.row.data.ContactName}
132+
></IgrInput>
133+
<IgrInput
134+
label='Title'
135+
onInput={(e: any) => cell.row.data.ContactTitle = e.detail}
136+
value={cell.row.data.ContactTitle}
137+
></IgrInput>
138+
<IgrInput
139+
label='Company'
140+
onInput={(e: any) => cell.row.data.Company = e.detail}
141+
value={cell.row.data.Company}
142+
></IgrInput>
146143
</div>
147-
</>
148144
);
149145
}
150146

@@ -184,30 +180,26 @@ export default class Sample extends React.Component<any, any> {
184180
return (
185181
<>
186182
<div className="contact-container--edit" style={{padding: "1rem"}}>
187-
<IgrInput label='Country' onInput={(e: any) =>
188-
{
189-
cell.row.data.Country = e.detail;
190-
grid.forceUpdate();
191-
}
192-
} value={cell.row.data.Country}></IgrInput>
193-
<IgrInput label='City' onInput={(e: any) =>
194-
{
195-
cell.row.data.City = e.detail;
196-
grid.forceUpdate();
197-
}
198-
} value={cell.row.data.City}></IgrInput>
199-
<IgrInput label='Postal Code' onInput={(e: any) =>
200-
{
201-
cell.row.data.PostalCode = e.detail;
202-
grid.forceUpdate();
203-
}
204-
} value={cell.row.data.PostalCode}></IgrInput>
205-
<IgrInput label='Phone' onInput={(e: any) =>
206-
{
207-
cell.row.data.Phone = e.detail;
208-
grid.forceUpdate();
209-
}
210-
} value={cell.row.data.Phone}></IgrInput>
183+
<IgrInput
184+
label='Country'
185+
onInput={(e: any) => cell.row.data.Country = e.detail}
186+
value={cell.row.data.Country}
187+
></IgrInput>
188+
<IgrInput
189+
label='City'
190+
onInput={(e: any) => cell.row.data.City = e.detail}
191+
value={cell.row.data.City}
192+
></IgrInput>
193+
<IgrInput
194+
label='Postal Code'
195+
onInput={(e: any) => cell.row.data.PostalCode = e.detail}
196+
value={cell.row.data.PostalCode}
197+
></IgrInput>
198+
<IgrInput
199+
label='Phone'
200+
onInput={(e: any) => cell.row.data.Phone = e.detail}
201+
value={cell.row.data.Phone}
202+
></IgrInput>
211203
</div>
212204
</>
213205
);

samples/grids/grid/multi-column-headers-template/src/index.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ export default class Sample extends React.Component<any, any> {
173173
c.hidden = !c.hidden;
174174
}
175175
}
176-
columnGroup.forceUpdate();
177176
this.columnGroupStates.set(columnGroup, !this.columnGroupStates.get(columnGroup));
178177
}
179178
}

samples/grids/hierarchical-grid/multi-column-headers-template/src/index.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ export default class Sample extends React.Component<any, any> {
300300
c.hidden = !c.hidden;
301301
}
302302
}
303-
columnGroup.forceUpdate();
304303
this.columnGroupStates.set(columnGroup, !this.columnGroupStates.get(columnGroup));
305304
}
306305
}

samples/grids/tree-grid/multi-column-headers-template/src/index.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ export default class Sample extends React.Component<any, any> {
175175
c.hidden = !c.hidden;
176176
}
177177
}
178-
columnGroup.forceUpdate();
179178
this.columnGroupStates.set(columnGroup, !this.columnGroupStates.get(columnGroup));
180179
}
181180
}

0 commit comments

Comments
 (0)