mirror of
https://github.com/lxsang/antos-frontend.git
synced 2025-02-22 01:42:47 +01:00
allow enable/disable grid resize feature
This commit is contained in:
parent
45d425d5db
commit
cc4081f9a0
@ -582,6 +582,7 @@ namespace OS {
|
|||||||
};
|
};
|
||||||
const grid = this.refs.gridview as GridViewTag;
|
const grid = this.refs.gridview as GridViewTag;
|
||||||
const list = this.refs.listview as ListViewTag;
|
const list = this.refs.listview as ListViewTag;
|
||||||
|
grid.resizable = true;
|
||||||
grid.header = this._header;
|
grid.header = this._header;
|
||||||
tree.dragndrop = true;
|
tree.dragndrop = true;
|
||||||
list.dragndrop = true;
|
list.dragndrop = true;
|
||||||
|
@ -443,6 +443,7 @@ namespace OS {
|
|||||||
this._selectedRows = [];
|
this._selectedRows = [];
|
||||||
this._selectedRow = undefined;
|
this._selectedRow = undefined;
|
||||||
this._rows = [];
|
this._rows = [];
|
||||||
|
this.resizable = false;
|
||||||
this._oncellselect = this._onrowselect = this._oncelldbclick = (
|
this._oncellselect = this._onrowselect = this._oncelldbclick = (
|
||||||
e: TagEventType<CellEventData>
|
e: TagEventType<CellEventData>
|
||||||
): void => {};
|
): void => {};
|
||||||
@ -539,6 +540,7 @@ namespace OS {
|
|||||||
element.data = item;
|
element.data = item;
|
||||||
item.domel = element;
|
item.domel = element;
|
||||||
i++;
|
i++;
|
||||||
|
if (this.resizable) {
|
||||||
if (i != v.length) {
|
if (i != v.length) {
|
||||||
const rz = $(`<afx-resizer>`).appendTo(
|
const rz = $(`<afx-resizer>`).appendTo(
|
||||||
this.refs.header
|
this.refs.header
|
||||||
@ -557,6 +559,7 @@ namespace OS {
|
|||||||
rz.uify(this.observable);
|
rz.uify(this.observable);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.calibrate();
|
this.calibrate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -623,6 +626,20 @@ namespace OS {
|
|||||||
return this.hasattr("multiselect");
|
return this.hasattr("multiselect");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set and Get the resizable attribute
|
||||||
|
*
|
||||||
|
* This allows to enable/disable column resize feature
|
||||||
|
*
|
||||||
|
* @memberof GridViewTag
|
||||||
|
*/
|
||||||
|
set resizable(v: boolean) {
|
||||||
|
this.attsw(v, "resizable");
|
||||||
|
}
|
||||||
|
get resizable(): boolean {
|
||||||
|
return this.hasattr("resizable");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete a grid rows
|
* Delete a grid rows
|
||||||
*
|
*
|
||||||
@ -867,7 +884,7 @@ namespace OS {
|
|||||||
template += `${v}px `;
|
template += `${v}px `;
|
||||||
i++;
|
i++;
|
||||||
template_header += `${v}px `;
|
template_header += `${v}px `;
|
||||||
if (i < colssize.length) {
|
if (i < colssize.length && this.resizable) {
|
||||||
template_header += "3px ";
|
template_header += "3px ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -139,7 +139,8 @@ namespace OS {
|
|||||||
*
|
*
|
||||||
* Getter:
|
* Getter:
|
||||||
* - get the resize event callback
|
* - get the resize event callback
|
||||||
* @memberof GridViewTag
|
*
|
||||||
|
* @memberof ResizerTag
|
||||||
*/
|
*/
|
||||||
set onelresize(v: TagEventCallback<any>) {
|
set onelresize(v: TagEventCallback<any>) {
|
||||||
this._onresize = v;
|
this._onresize = v;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user