jQWidgets Forums
Forum Replies Created
-
Author
-
May 19, 2022 at 4:58 am in reply to: row.boundindex in createwidget not correct row.boundindex in createwidget not correct #121731
Hi admin,
This way it can be solved.
Thanks very much.May 13, 2022 at 1:27 am in reply to: row.boundindex in createwidget not correct row.boundindex in createwidget not correct #121715Hi admin,
In fact, I want to be able to get row data in the button click event.For example, in the following “myButton.addEventHandler(‘click’, function ()”.
How do I do that?createwidget: (row: number, column: any, value: string, htmlElement: HTMLElement): void => {
const container = document.createElement(‘div’);
const id = myButton${this.counter};
container.id = id;
container.style.border = ‘none’;
htmlElement.appendChild(container);
const imgurl = ‘./../../../images/’ + value.toLowerCase() + ‘.png’;
const options = {
width: ‘100%’, height: 90, template: ‘success’,
imgSrc: imgurl, imgWidth: 40, imgHeight: 50, value: value,
imgPosition: ‘center’, textPosition: ‘center’, textImageRelation: ‘imageAboveText’
};
const myButton = jqwidgets.createInstance(#${id}, ‘jqxButton’, options);
myButton.addEventHandler(‘click’, function (): void {
const currentButtonValue = this.children[1].innerHTML;
alert(row.boundindex); // does not match when scrolling
alert(row.bounddata); // does not match when scrolling
alert(currentButtonValue);
});
this.counter++;
},
initwidget: (row: number, column: any, value: any, htmlElement: HTMLElement): void => {
const imgurl = ‘./../../../images/’ + value.toLowerCase() + ‘.png’;
(<HTMLImageElement>htmlElement.children[1].children[0]).src = imgurl;
htmlElement.children[1].children[1].innerHTML = value;
}May 11, 2022 at 5:56 am in reply to: row.boundindex in createwidget not correct row.boundindex in createwidget not correct #121706Hi, admin:
Thanks for your reply! I’ve seen this code,but the issue what the bounddata of row does not match when scrolling with createwidget method does not resolved.
The code of mine like this:createwidget: (row: number, column: any, value: string, htmlElement: HTMLElement): void => {
const container = document.createElement(‘div’);
const id =myButton${this.counter}
;
container.id = id;
container.style.border = ‘none’;
htmlElement.appendChild(container);
const imgurl = ‘./../../../images/’ + value.toLowerCase() + ‘.png’;
const options = {
width: ‘100%’, height: 90, template: ‘success’,
imgSrc: imgurl, imgWidth: 40, imgHeight: 50, value: value,
imgPosition: ‘center’, textPosition: ‘center’, textImageRelation: ‘imageAboveText’
};
const myButton = jqwidgets.createInstance(#${id}
, ‘jqxButton’, options);
myButton.addEventHandler(‘click’, function (): void {
const currentButtonValue = this.children[1].innerHTML;
alert(row.boundindex); // does not match when scrolling
alert(row.bounddata); // does not match when scrolling
alert(currentButtonValue);
});
this.counter++;
},
initwidget: (row: number, column: any, value: any, htmlElement: HTMLElement): void => {
const imgurl = ‘./../../../images/’ + value.toLowerCase() + ‘.png’;
(<HTMLImageElement>htmlElement.children[1].children[0]).src = imgurl;
htmlElement.children[1].children[1].innerHTML = value;
}May 6, 2022 at 10:49 am in reply to: row.boundindex in createwidget not correct row.boundindex in createwidget not correct #121691Hi, admin:
can you please provide a sample code for the row’s boundindex and bounddata are up to date in the initwidget ?
Thanks.May 5, 2022 at 6:27 am in reply to: row.boundindex in createwidget not correct row.boundindex in createwidget not correct #121681Hi, this topic has another issue, the bounddata of row does not match when scrolling with createwidget method.
Please let me know if any way can fix this issue. Thanks.
This is demo image
link:https://pan.baidu.com/s/1vgRQ4drVk4gQ4iaTfqsWGw
key:ul2j -
AuthorPosts