fixbugs grid
This commit is contained in:

parent
53b8b89e68
commit
bf6d03df63
@ -617,62 +617,62 @@ export default {
|
||||
list.map(item => this.gridInstance.invoke('check', item));
|
||||
},
|
||||
refreshLayout() {
|
||||
// console.log("---------DEBUG---refreshLayout: ");
|
||||
this.gridInstance.invoke('refreshLayout');
|
||||
},
|
||||
refreshGrid(){
|
||||
console.log("---------DEBUG---refreshGrid: ");
|
||||
// console.log("refreshLayout",this.$refs['tuigrid' + this.gridName])
|
||||
var store = this.$refs['tuigrid' + this.gridName].gridInstance.store;
|
||||
var containerEl = this.$refs['tuigrid' + this.gridName].$el;
|
||||
// var containerEl = document.querySelector('.tui-grid-container')
|
||||
var parentEl = containerEl.parentElement;
|
||||
|
||||
|
||||
|
||||
// console.log("containerEl : ",containerEl);
|
||||
// console.log('parentEl : ', parentEl)
|
||||
// function refreshLayout(store, containerEl, parentEl) {
|
||||
var dimension = store.dimension;
|
||||
var autoWidth = dimension.autoWidth, fitToParentHeight = dimension.fitToParentHeight;
|
||||
var clientHeight = containerEl.clientHeight, clientWidth = containerEl.clientWidth, scrollTop = containerEl.scrollTop, scrollLeft = containerEl.scrollLeft;
|
||||
var _a = containerEl.getBoundingClientRect(), top = _a.top, left = _a.left;
|
||||
this.setOffsetTop(store, top + scrollTop);
|
||||
// store.dimension.setOffsetTop = top + scrollTop;
|
||||
this.setOffsetLeft(store, left + scrollLeft);
|
||||
// store.dimension.headerHeight = left + scrollLeft;
|
||||
this.setWidth(store, clientWidth, autoWidth);
|
||||
// store.dimension.autoWidth = autoWidth;
|
||||
// store.dimension.width = clientWidth;
|
||||
// console.log("###",getComputedStyle(parentEl));
|
||||
// console.log("fitToParentHeight : ",fitToParentHeight);
|
||||
// console.log("parentEl : ",parentEl)
|
||||
// console.log("parentEl.clientHeight" , parentEl.clientHeight)
|
||||
// console.log("clientHeight : ",clientHeight);
|
||||
if (parentEl && parentEl.clientHeight !== clientHeight) {
|
||||
var _b = getComputedStyle(parentEl), paddingTop = _b.paddingTop, paddingBottom = _b.paddingBottom;
|
||||
this.setHeight(store, parentEl.clientHeight - (parseFloat(paddingTop) + parseFloat(paddingBottom)));
|
||||
}
|
||||
|
||||
// console.log("---------DEBUG---containerEl: ",containerEl);
|
||||
// console.log('---------DEBUG---parentEl: ', parentEl)
|
||||
// function refreshLayout(store, containerEl, parentEl) {
|
||||
var dimension = store.dimension;
|
||||
var autoWidth = dimension.autoWidth, fitToParentHeight = dimension.fitToParentHeight;
|
||||
var clientHeight = containerEl.clientHeight, clientWidth = containerEl.clientWidth, scrollTop = containerEl.scrollTop, scrollLeft = containerEl.scrollLeft;
|
||||
var _a = containerEl.getBoundingClientRect(), top = _a.top, left = _a.left;
|
||||
this.setOffsetTop(store, top + scrollTop);
|
||||
// store.dimension.setOffsetTop = top + scrollTop;
|
||||
this.setOffsetLeft(store, left + scrollLeft);
|
||||
// store.dimension.headerHeight = left + scrollLeft;
|
||||
this.setWidth(store, clientWidth, autoWidth);
|
||||
// store.dimension.autoWidth = autoWidth;
|
||||
// store.dimension.width = clientWidth;
|
||||
// console.log("###",getComputedStyle(parentEl));
|
||||
// console.log("fitToParentHeight : ",fitToParentHeight);
|
||||
// console.log("parentEl : ",parentEl)
|
||||
// console.log("parentEl.clientHeight" , parentEl.clientHeight)
|
||||
// console.log("clientHeight : ",clientHeight);
|
||||
if (parentEl && parentEl.clientHeight !== clientHeight) {
|
||||
var _b = getComputedStyle(parentEl), paddingTop = _b.paddingTop, paddingBottom = _b.paddingBottom;
|
||||
this.setHeight(store, parentEl.clientHeight - (parseFloat(paddingTop) + parseFloat(paddingBottom)));
|
||||
}
|
||||
// }
|
||||
},
|
||||
setOffsetTop(store, offsetTop) {
|
||||
// console.log("setOffsetTop");
|
||||
// console.log("---------DEBUG---setOffsetTop: ");
|
||||
store.dimension.offsetTop = offsetTop;
|
||||
},
|
||||
setWidth(_a, width, autoWidth) {
|
||||
// console.log("setWidth");
|
||||
// console.log("---------DEBUG---setWidth: ");
|
||||
var dimension = _a.dimension;
|
||||
dimension.autoWidth = autoWidth;
|
||||
dimension.width = width;
|
||||
},
|
||||
setHeaderHeight(store, height) {
|
||||
// console.log("setHeaderHeight")
|
||||
// console.log("---------DEBUG---setHeaderHeight: ");
|
||||
store.dimension.headerHeight = height;
|
||||
},
|
||||
setOffsetLeft(store, offsetLeft) {
|
||||
// console.log("setOffsetLeft")
|
||||
// console.log("---------DEBUG---setOffsetLeft: ");
|
||||
store.dimension.offsetLeft = offsetLeft;
|
||||
},
|
||||
setHeight(_a,height){
|
||||
// console.log("setHeight");
|
||||
// console.log("---------DEBUG---setHeight: ");
|
||||
var dimension = _a.dimension;
|
||||
var headerHeight = dimension.headerHeight, summaryHeight = dimension.summaryHeight, tableBorderWidth = dimension.tableBorderWidth;
|
||||
dimension.bodyHeight = height - headerHeight - summaryHeight - tableBorderWidth;
|
||||
@ -703,10 +703,11 @@ export default {
|
||||
// resetData() {
|
||||
// // console.log("resetData = ", this.tuigridProps.data);
|
||||
// this.$refs.tuigrid.invoke("resetData", this.tuigridProps.data);
|
||||
// }
|
||||
// },
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
::v-deep .tui-grid-container {
|
||||
.tui-grid-content-area {
|
||||
|
Reference in New Issue
Block a user