@syncfusion/ej2-lists 23.1.42 → 23.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/ej2-lists.min.js +2 -2
- package/dist/ej2-lists.umd.min.js +2 -2
- package/dist/ej2-lists.umd.min.js.map +1 -1
- package/dist/es6/ej2-lists.es2015.js +77 -196
- package/dist/es6/ej2-lists.es2015.js.map +1 -1
- package/dist/es6/ej2-lists.es5.js +86 -206
- package/dist/es6/ej2-lists.es5.js.map +1 -1
- package/dist/global/ej2-lists.min.js +2 -2
- package/dist/global/ej2-lists.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +8 -8
- package/src/common/list-base.js +2 -1
- package/src/list-view/list-view.d.ts +3 -1
- package/src/list-view/list-view.js +16 -5
- package/src/list-view/virtualization.d.ts +2 -9
- package/src/list-view/virtualization.js +68 -200
- package/dist/ts/common/list-base.ts +0 -1286
- package/dist/ts/component.ts +0 -4
- package/dist/ts/list-view/list-view.ts +0 -2653
- package/dist/ts/list-view/virtualization.ts +0 -1187
- package/dist/ts/sortable/sortable.ts +0 -485
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Animation, Base, ChildProperty, Complex, Component, Draggable, Event, EventHandler, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, addClass, animationMode, append, attributes, closest, compareElementParent, compile, detach, extend, formatUnit, getComponent, getUniqueID, getValue, isBlazor, isNullOrUndefined, isVisible, merge, prepend, remove, removeClass, rippleEffect } from '@syncfusion/ej2-base';
|
|
1
|
+
import { Animation, Base, ChildProperty, Complex, Component, Draggable, Event, EventHandler, NotifyPropertyChanges, Property, SanitizeHtmlHelper, Touch, addClass, animationMode, append, attributes, closest, compareElementParent, compile, detach, extend, formatUnit, getComponent, getUniqueID, getValue, isBlazor, isNullOrUndefined, isVisible, merge, prepend, remove, removeClass, rippleEffect, select } from '@syncfusion/ej2-base';
|
|
2
2
|
import { DataManager, Query } from '@syncfusion/ej2-data';
|
|
3
3
|
import { createCheckBox } from '@syncfusion/ej2-buttons';
|
|
4
4
|
|
|
@@ -286,7 +286,8 @@ var ListBase;
|
|
|
286
286
|
anchorElement = li.querySelector('.' + cssClass.anchorWrap);
|
|
287
287
|
// eslint-disable-next-line no-prototype-builtins
|
|
288
288
|
if (fieldData.hasOwnProperty(fields.tooltip)) {
|
|
289
|
-
|
|
289
|
+
const tooltipText = SanitizeHtmlHelper.sanitize(fieldData[fields.tooltip]);
|
|
290
|
+
li.setAttribute('title', tooltipText);
|
|
290
291
|
}
|
|
291
292
|
// eslint-disable-next-line no-prototype-builtins
|
|
292
293
|
if (fieldData.hasOwnProperty(fields.htmlAttributes) && fieldData[fields.htmlAttributes]) {
|
|
@@ -2758,16 +2759,17 @@ let ListView = class ListView extends Component {
|
|
|
2758
2759
|
*
|
|
2759
2760
|
* @param {Fields} fields - Target item to add the given data as its children (can be null).
|
|
2760
2761
|
*
|
|
2762
|
+
* @param {number} index - Indicates the index where the data to be added.
|
|
2761
2763
|
*/
|
|
2762
|
-
addItem(data, fields = undefined) {
|
|
2764
|
+
addItem(data, fields = undefined, index) {
|
|
2763
2765
|
const dataSource = this.dataSource instanceof DataManager
|
|
2764
2766
|
? this.localData : this.dataSource;
|
|
2765
|
-
this.addItemInternally(data, fields, dataSource);
|
|
2767
|
+
this.addItemInternally(data, fields, dataSource, index);
|
|
2766
2768
|
}
|
|
2767
|
-
addItemInternally(data, fields, dataSource) {
|
|
2769
|
+
addItemInternally(data, fields, dataSource, index) {
|
|
2768
2770
|
if (data instanceof Array) {
|
|
2769
2771
|
if (this.enableVirtualization) {
|
|
2770
|
-
this.virtualizationModule.addItem(data, fields, dataSource);
|
|
2772
|
+
this.virtualizationModule.addItem(data, fields, dataSource, index);
|
|
2771
2773
|
}
|
|
2772
2774
|
else {
|
|
2773
2775
|
const ds = this.findItemFromDS(dataSource, fields);
|
|
@@ -2783,7 +2785,7 @@ let ListView = class ListView extends Component {
|
|
|
2783
2785
|
// check for whether target is nested level or top level in list
|
|
2784
2786
|
if (ds instanceof Array) {
|
|
2785
2787
|
for (let i = 0; i < data.length; i++) {
|
|
2786
|
-
dataSource.
|
|
2788
|
+
dataSource = this.addItemAtIndex(index, dataSource, data[i]);
|
|
2787
2789
|
this.setViewDataSource(dataSource);
|
|
2788
2790
|
// since it is top level target, get the content container's first child
|
|
2789
2791
|
// as it is always the top level UL
|
|
@@ -2811,6 +2813,16 @@ let ListView = class ListView extends Component {
|
|
|
2811
2813
|
}
|
|
2812
2814
|
}
|
|
2813
2815
|
}
|
|
2816
|
+
addItemAtIndex(index, newDataSource, itemData) {
|
|
2817
|
+
let isIndexValid = !(isNullOrUndefined(index)) && index >= 0 && index < newDataSource.length && isNullOrUndefined(this.listBaseOption.fields.groupBy);
|
|
2818
|
+
if (isIndexValid) {
|
|
2819
|
+
newDataSource.splice(index, 0, itemData);
|
|
2820
|
+
}
|
|
2821
|
+
else {
|
|
2822
|
+
newDataSource.push(itemData);
|
|
2823
|
+
}
|
|
2824
|
+
return newDataSource;
|
|
2825
|
+
}
|
|
2814
2826
|
addItemInNestedList(targetItemData, itemQueue) {
|
|
2815
2827
|
// eslint-disable-next-line
|
|
2816
2828
|
const targetItemId = targetItemData[this.fields.id];
|
|
@@ -3103,10 +3115,6 @@ class Virtualization {
|
|
|
3103
3115
|
* @private
|
|
3104
3116
|
*/
|
|
3105
3117
|
uiVirtualization() {
|
|
3106
|
-
this.commonTemplate = '<div class="e-text-content" role="presentation"> ' +
|
|
3107
|
-
'<span class="e-list-text"> ${' + this.listViewInstance.fields.text + '} </span></div>';
|
|
3108
|
-
this.templateFunction = compile(this.listViewInstance.template || this.commonTemplate, this.listViewInstance);
|
|
3109
|
-
this.groupTemplateFunction = compile(this.listViewInstance.groupTemplate || this.commonTemplate, this.listViewInstance);
|
|
3110
3118
|
this.wireScrollEvent(false);
|
|
3111
3119
|
const curViewDS = this.listViewInstance.curViewDS;
|
|
3112
3120
|
const firstDs = curViewDS.slice(0, 1);
|
|
@@ -3238,6 +3246,9 @@ class Virtualization {
|
|
|
3238
3246
|
}
|
|
3239
3247
|
onVirtualUiScroll(e) {
|
|
3240
3248
|
let startingHeight;
|
|
3249
|
+
const curViewDS = this.listViewInstance.curViewDS;
|
|
3250
|
+
this.listItemHeight = select(".e-list-item", this.listViewInstance.element).getBoundingClientRect().height;
|
|
3251
|
+
this.totalHeight = (Object.keys(curViewDS).length * this.listItemHeight) - (this.domItemCount * this.listItemHeight);
|
|
3241
3252
|
if (this.listViewInstance.isWindow) {
|
|
3242
3253
|
startingHeight = this.listViewInstance.ulElement.getBoundingClientRect().top -
|
|
3243
3254
|
document.documentElement.getBoundingClientRect().top;
|
|
@@ -3353,7 +3364,13 @@ class Virtualization {
|
|
|
3353
3364
|
if (!element.querySelector('.' + classNames.checkboxWrapper)) {
|
|
3354
3365
|
element.classList.add(classNames.checklist);
|
|
3355
3366
|
textContent.classList.add(classNames.checkbox);
|
|
3356
|
-
|
|
3367
|
+
if (this.listViewInstance.checkBoxPosition === 'Left') {
|
|
3368
|
+
textContent.classList.add('e-checkbox-left');
|
|
3369
|
+
}
|
|
3370
|
+
else {
|
|
3371
|
+
textContent.classList.add('e-checkbox-right');
|
|
3372
|
+
}
|
|
3373
|
+
textContent.append(this.checkListWrapper.cloneNode(true));
|
|
3357
3374
|
}
|
|
3358
3375
|
}
|
|
3359
3376
|
}
|
|
@@ -3771,11 +3788,11 @@ class Virtualization {
|
|
|
3771
3788
|
});
|
|
3772
3789
|
}
|
|
3773
3790
|
}
|
|
3774
|
-
addItem(data, fields, dataSource) {
|
|
3791
|
+
addItem(data, fields, dataSource, index) {
|
|
3775
3792
|
for (let i = 0; i < data.length; i++) {
|
|
3776
3793
|
const currentItem = data[i];
|
|
3777
3794
|
// push the given data to main data array
|
|
3778
|
-
dataSource.
|
|
3795
|
+
dataSource = this.listViewInstance.addItemAtIndex(index, dataSource, currentItem);
|
|
3779
3796
|
// recalculate all the group data or other datasource related things
|
|
3780
3797
|
this.listViewInstance.setViewDataSource(dataSource);
|
|
3781
3798
|
// render list items for first time due to no datasource present earlier
|
|
@@ -3855,191 +3872,50 @@ class Virtualization {
|
|
|
3855
3872
|
this.refreshItemHeight();
|
|
3856
3873
|
}
|
|
3857
3874
|
createUIItem(args) {
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
}
|
|
3874
|
-
[].slice.call(nodes).forEach((ele) => {
|
|
3875
|
-
div.appendChild(ele);
|
|
3876
|
-
});
|
|
3877
|
-
if (div.children && div.children[0]) {
|
|
3878
|
-
div.children[0].classList.add('e-checkbox');
|
|
3879
|
-
if (this.listViewInstance.checkBoxPosition === 'Left') {
|
|
3880
|
-
div.children[0].classList.add('e-checkbox-left');
|
|
3881
|
-
}
|
|
3882
|
-
else {
|
|
3883
|
-
div.children[0].classList.add('e-checkbox-right');
|
|
3884
|
-
}
|
|
3885
|
-
if (this.listViewInstance.checkBoxPosition === 'Left') {
|
|
3886
|
-
div.children[0].insertBefore(this.listViewInstance.virtualCheckBox, div.childNodes[0].children[0]);
|
|
3887
|
-
}
|
|
3888
|
-
else {
|
|
3889
|
-
div.children[0].appendChild(this.listViewInstance.virtualCheckBox);
|
|
3875
|
+
if (!args.item.classList.contains("e-list-group-item")) {
|
|
3876
|
+
this.templateData = args.curData.isHeader ? args.curData.items[0] :
|
|
3877
|
+
args.curData;
|
|
3878
|
+
if (this.listViewInstance.showCheckBox) {
|
|
3879
|
+
// eslint-disable-next-line
|
|
3880
|
+
this.listViewInstance.renderCheckbox(args);
|
|
3881
|
+
if ((!isNullOrUndefined(this.listViewInstance.virtualCheckBox)) &&
|
|
3882
|
+
(!isNullOrUndefined(this.listViewInstance.virtualCheckBox.outerHTML))) {
|
|
3883
|
+
const div = document.createElement('div');
|
|
3884
|
+
const commonTemplate = '<div class="e-text-content" role="presentation"> ' +
|
|
3885
|
+
'<span class="e-list-text"> ${' + this.listViewInstance.fields.text + '} </span></div>';
|
|
3886
|
+
const templateFunction = compile(this.listViewInstance.template || commonTemplate, this.listViewInstance);
|
|
3887
|
+
const nodes = templateFunction(this.templateData, this.listViewInstance);
|
|
3888
|
+
if (this.listViewInstance.template && this.listViewInstance.isReact) {
|
|
3889
|
+
this.listViewInstance.renderReactTemplates();
|
|
3890
3890
|
}
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
}
|
|
3915
|
-
if (args.curData.isHeader) {
|
|
3916
|
-
this.headerData = args.curData;
|
|
3917
|
-
}
|
|
3918
|
-
const groupTemplate = this.listViewInstance.createElement('div');
|
|
3919
|
-
if (this.listViewInstance.fields.groupBy) {
|
|
3920
|
-
const nodes = this.groupTemplateFunction(this.headerData, this.listViewInstance);
|
|
3921
|
-
if (this.listViewInstance.template && this.listViewInstance.isReact) {
|
|
3922
|
-
this.listViewInstance.renderReactTemplates();
|
|
3923
|
-
}
|
|
3924
|
-
[].slice.call(nodes).forEach((ele) => {
|
|
3925
|
-
groupTemplate.appendChild(ele);
|
|
3926
|
-
});
|
|
3927
|
-
}
|
|
3928
|
-
if ((!this.listViewInstance.isReact || (typeof this.listViewInstance.template == "string" && !args.item.classList.contains("e-list-group-item")) ||
|
|
3929
|
-
(typeof this.listViewInstance.groupTemplate == "string" && args.item.classList.contains("e-list-group-item"))) && !this.listViewInstance.isVue) {
|
|
3930
|
-
args.item.innerHTML = '';
|
|
3931
|
-
}
|
|
3932
|
-
args.item.context = { data: args.curData, nodes: { flatTemplateNodes: [], groupTemplateNodes: [] } };
|
|
3933
|
-
for (let i = 0; i < template.children.length; i++) {
|
|
3934
|
-
this.compileTemplate(template.children[i], args.item, false);
|
|
3935
|
-
}
|
|
3936
|
-
for (let i = 0; i < groupTemplate.children.length; i++) {
|
|
3937
|
-
this.compileTemplate(groupTemplate.children[i], args.item, true);
|
|
3938
|
-
}
|
|
3939
|
-
args.item.context.template = args.curData.isHeader ? template.firstElementChild :
|
|
3940
|
-
groupTemplate.firstElementChild;
|
|
3941
|
-
args.item.context.type = args.curData.isHeader ? 'flatList' : 'groupList';
|
|
3942
|
-
const element = args.curData.isHeader ? groupTemplate : template;
|
|
3943
|
-
if (element.firstElementChild && !this.listViewInstance.isReact && !this.listViewInstance.isVue) {
|
|
3944
|
-
args.item.insertBefore(element.firstElementChild, null);
|
|
3945
|
-
}
|
|
3946
|
-
}
|
|
3947
|
-
compileTemplate(element, item, isHeader) {
|
|
3948
|
-
const subNode = {};
|
|
3949
|
-
subNode.onChange = (value) => {
|
|
3950
|
-
let groupTemplateElements;
|
|
3951
|
-
let templateElements;
|
|
3952
|
-
if (this.listViewInstance.isVue) {
|
|
3953
|
-
groupTemplateElements = this.groupTemplateFunction(value);
|
|
3954
|
-
templateElements = this.templateFunction(value);
|
|
3955
|
-
}
|
|
3956
|
-
else {
|
|
3957
|
-
groupTemplateElements = this.groupTemplateFunction(value, this.listViewInstance);
|
|
3958
|
-
templateElements = this.templateFunction(value, this.listViewInstance);
|
|
3959
|
-
}
|
|
3960
|
-
if (this.listViewInstance.template && this.listViewInstance.isReact) {
|
|
3961
|
-
this.listViewInstance.renderReactTemplates();
|
|
3962
|
-
}
|
|
3963
|
-
let currentTemplate = templateElements;
|
|
3964
|
-
if (value.isHeader) {
|
|
3965
|
-
currentTemplate = groupTemplateElements;
|
|
3966
|
-
}
|
|
3967
|
-
[].slice.call(currentTemplate).forEach(function (currentElement) {
|
|
3968
|
-
let RemovableClass = element.classList.value.replace('e-checkbox', '');
|
|
3969
|
-
RemovableClass = RemovableClass.replace('e-checkbox-left', '');
|
|
3970
|
-
RemovableClass = RemovableClass.replace('e-checkbox-right', '');
|
|
3971
|
-
removeClass([element], RemovableClass.split(' ').filter(function (css) { return css; }));
|
|
3972
|
-
addClass([element], Array.from(currentElement.classList));
|
|
3973
|
-
for (let i = 0; i < element.attributes.length; i++) {
|
|
3974
|
-
if (element.attributes[i].name != 'class') {
|
|
3975
|
-
const newData = currentElement.getAttribute(element.attributes[i].name);
|
|
3976
|
-
element.setAttribute(element.attributes[i].name, newData);
|
|
3891
|
+
[].slice.call(nodes).forEach((ele) => {
|
|
3892
|
+
div.appendChild(ele);
|
|
3893
|
+
});
|
|
3894
|
+
if (div.children && div.children[0]) {
|
|
3895
|
+
div.children[0].classList.add('e-checkbox');
|
|
3896
|
+
if (this.listViewInstance.checkBoxPosition === 'Left') {
|
|
3897
|
+
div.children[0].classList.add('e-checkbox-left');
|
|
3898
|
+
}
|
|
3899
|
+
else {
|
|
3900
|
+
div.children[0].classList.add('e-checkbox-right');
|
|
3901
|
+
}
|
|
3902
|
+
if (this.listViewInstance.checkBoxPosition === 'Left') {
|
|
3903
|
+
div.children[0].insertBefore(this.listViewInstance.virtualCheckBox, div.childNodes[0].children[0]);
|
|
3904
|
+
}
|
|
3905
|
+
else {
|
|
3906
|
+
div.children[0].appendChild(this.listViewInstance.virtualCheckBox);
|
|
3907
|
+
}
|
|
3908
|
+
while (args.item.lastChild) {
|
|
3909
|
+
args.item.removeChild(args.item.lastChild);
|
|
3910
|
+
}
|
|
3911
|
+
[].slice.call(div.children).forEach(function (ele) {
|
|
3912
|
+
args.item.appendChild(ele);
|
|
3913
|
+
});
|
|
3977
3914
|
}
|
|
3978
3915
|
}
|
|
3979
|
-
[].slice.call(element.children).forEach(function (ele) {
|
|
3980
|
-
if (!ele.classList.contains('e-listview-checkbox') && !(ele.classList.contains('e-checkbox-left') || ele.classList.contains('e-checkbox-right'))) {
|
|
3981
|
-
ele.remove();
|
|
3982
|
-
}
|
|
3983
|
-
});
|
|
3984
|
-
[].slice.call(currentElement.children).forEach(function (ele) {
|
|
3985
|
-
element.appendChild(ele);
|
|
3986
|
-
});
|
|
3987
|
-
});
|
|
3988
|
-
};
|
|
3989
|
-
this.updateContextData(item, subNode, isHeader);
|
|
3990
|
-
}
|
|
3991
|
-
onChange(newData, listElement) {
|
|
3992
|
-
listElement.context.data = newData;
|
|
3993
|
-
// eslint-disable-next-line max-len
|
|
3994
|
-
const groupTemplateNodes = listElement.context.nodes.groupTemplateNodes;
|
|
3995
|
-
// eslint-disable-next-line max-len
|
|
3996
|
-
const flatTemplateNodes = listElement.context.nodes.flatTemplateNodes;
|
|
3997
|
-
// eslint-disable-next-line
|
|
3998
|
-
if (!isNullOrUndefined(newData.isHeader) && newData.isHeader && listElement.context.type === 'groupList') {
|
|
3999
|
-
// eslint-disable-next-line
|
|
4000
|
-
const element = listElement.firstElementChild;
|
|
4001
|
-
detach(listElement.firstElementChild);
|
|
4002
|
-
listElement.insertBefore(listElement.context.template, null);
|
|
4003
|
-
listElement.context.template = element;
|
|
4004
|
-
listElement.context.type = 'flatList';
|
|
4005
|
-
for (let i = 0; i < groupTemplateNodes.length; i++) {
|
|
4006
|
-
// eslint-disable-next-line
|
|
4007
|
-
groupTemplateNodes[i].onChange(newData);
|
|
4008
|
-
}
|
|
4009
|
-
}
|
|
4010
|
-
else if (!newData.isHeader && listElement.context.type === 'flatList') {
|
|
4011
|
-
const element = listElement.firstElementChild;
|
|
4012
|
-
detach(listElement.firstElementChild);
|
|
4013
|
-
listElement.insertBefore(listElement.context.template, null);
|
|
4014
|
-
listElement.context.template = element;
|
|
4015
|
-
listElement.context.type = 'groupList';
|
|
4016
|
-
for (let i = 0; i < flatTemplateNodes.length; i++) {
|
|
4017
|
-
// eslint-disable-next-line
|
|
4018
|
-
flatTemplateNodes[i].onChange(newData);
|
|
4019
|
-
}
|
|
4020
|
-
}
|
|
4021
|
-
else if (!newData.isHeader) {
|
|
4022
|
-
for (let i = 0; i < flatTemplateNodes.length; i++) {
|
|
4023
|
-
// eslint-disable-next-line
|
|
4024
|
-
flatTemplateNodes[i].onChange(newData);
|
|
4025
|
-
}
|
|
4026
|
-
}
|
|
4027
|
-
else {
|
|
4028
|
-
for (let i = 0; i < groupTemplateNodes.length; i++) {
|
|
4029
|
-
// eslint-disable-next-line
|
|
4030
|
-
groupTemplateNodes[i].onChange(newData);
|
|
4031
3916
|
}
|
|
4032
3917
|
}
|
|
4033
3918
|
}
|
|
4034
|
-
// eslint-disable-next-line
|
|
4035
|
-
updateContextData(listElement, node, isHeader) {
|
|
4036
|
-
if (isHeader) {
|
|
4037
|
-
listElement.context.nodes.groupTemplateNodes.push(node);
|
|
4038
|
-
}
|
|
4039
|
-
else {
|
|
4040
|
-
listElement.context.nodes.flatTemplateNodes.push(node);
|
|
4041
|
-
}
|
|
4042
|
-
}
|
|
4043
3919
|
reRenderUiVirtualization() {
|
|
4044
3920
|
this.wireScrollEvent(true);
|
|
4045
3921
|
if (this.listViewInstance.contentContainer) {
|
|
@@ -4054,7 +3930,7 @@ class Virtualization {
|
|
|
4054
3930
|
}
|
|
4055
3931
|
updateUI(element, index, targetElement) {
|
|
4056
3932
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
4057
|
-
const onChange = this.isNgTemplate() ? this.onNgChange :
|
|
3933
|
+
const onChange = this.isNgTemplate() ? this.onNgChange : this.onChange;
|
|
4058
3934
|
if (this.listViewInstance.template || this.listViewInstance.groupTemplate) {
|
|
4059
3935
|
const curViewDS = this.listViewInstance.curViewDS[index];
|
|
4060
3936
|
// eslint-disable-next-line
|
|
@@ -4078,14 +3954,19 @@ class Virtualization {
|
|
|
4078
3954
|
* @param {ElementContext} listElement - The HTML element context for the list view.
|
|
4079
3955
|
* @param {Virtualization} virtualThis - The virtualization context for the list view.
|
|
4080
3956
|
*/
|
|
4081
|
-
|
|
3957
|
+
onChange(newData, listElement, virtualThis) {
|
|
4082
3958
|
let liItem = ListBase.createListItemFromJson(virtualThis.listViewInstance.createElement,
|
|
4083
3959
|
// eslint-disable-next-line
|
|
4084
3960
|
[newData], virtualThis.listViewInstance.listBaseOption, null, null, virtualThis.listViewInstance);
|
|
3961
|
+
if (virtualThis.listViewInstance.isReact) {
|
|
3962
|
+
virtualThis.listViewInstance.renderReactTemplates();
|
|
3963
|
+
}
|
|
4085
3964
|
while (listElement.lastChild) {
|
|
4086
3965
|
listElement.removeChild(listElement.lastChild);
|
|
4087
3966
|
}
|
|
4088
|
-
|
|
3967
|
+
[].slice.call(liItem[0].children).forEach(function (ele) {
|
|
3968
|
+
listElement.appendChild(ele);
|
|
3969
|
+
});
|
|
4089
3970
|
}
|
|
4090
3971
|
onNgChange(newData, listElement, virtualThis) {
|
|
4091
3972
|
// compile given target element with template for new data
|