Hello,
I have a table component I have made that I want to include code at the beginning, but also be editable. For table data I have the following code
<button onclick="cecontrol('row') ">–/+</buton>
<table border=" 0" cellspacing="0" cellpadding="1" width="100%" id="row">
I can put that in, and it works until it is edited. Once it is edited the first line is deleted and the id="row" is deleted. Is there a way to code it so that is always included in that component?
Solved! Go to Solution.
A simple hack would be to extend the table component, add your button in the JSP, and then parse the HTML from the text property and add your id value to the table tag. It's a hack but it would work.
The complicated version would be to look at overriding the Ext JS Table Plugin for the Rich Text Editor widget and change its behavior so it either ignores your code, or adds it in automatically for you. I don't have examples of that for you, but you can take a look at http://dev.day.com/docs/en/cq/current/developing/widgets.html#par_title_3 for information on rich text plugins generally.
A simple hack would be to extend the table component, add your button in the JSP, and then parse the HTML from the text property and add your id value to the table tag. It's a hack but it would work.
The complicated version would be to look at overriding the Ext JS Table Plugin for the Rich Text Editor widget and change its behavior so it either ignores your code, or adds it in automatically for you. I don't have examples of that for you, but you can take a look at http://dev.day.com/docs/en/cq/current/developing/widgets.html#par_title_3 for information on rich text plugins generally.
Thanks for your quick response,
The problem with the first solution is that anytime the table is edited, it generates the default table border, cellspacing, cellpadding line of code and ignores the id="row" because of this. The button does stay, but it no longer functions.
Views
Replies
Total Likes
That's why you have to parse the text in the JSP when the component renders - you don't edit the row attribute in the content, you parse the content and add everytime your JSP renders - that's how you get around the behavior of the widget.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies