This is a migrated thread and some comments may be shown as answers.

Insert Table and Table Accessibility (THEAD -TH)

3 Answers 96 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Dario
Top achievements
Rank 1
Dario asked on 02 Apr 2009, 02:41 PM
Hello,

By default the "Insert Table" button creates a table with a <TBODY> tag only:

"AS IS"
<table>
    <tbody>
        <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
    </tbody>
</table>

Is it possible to override this behavior in order to insert the first row within the <THEAD> tag automatically and avoid to set this property via "Table Properties - Accessibility" tab?

"DESIDERATA"
<table>
    <thead>
        <tr>
            <th >&nbsp;</th>
            <th >&nbsp;</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
    </tbody>
</table>

Thanks,
Dario.

3 Answers, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 06 Apr 2009, 07:40 AM
Hello Dario,

It is possible to overwrite the command. But in order to help you further I need to know which version of RadEditor for MOSS are you using? So please provide me with this information and will give you a corresponding example of how to overwrite the InsertTable command. 


Greetings,
Stanimir
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Dario
Top achievements
Rank 1
answered on 06 Apr 2009, 08:02 AM
Hello Stanimir,

We are testing the demo version of the product, so the version number is 5.3.2.0.
Nevertheless we're going to buy the latest version of RadControls for ASP.NET AJAX ,so if it includes a different version of RadEditor for MOSS, please could you also provide us with the related example?

Thank you for your support.
Dario.
0
Stanimir
Telerik team
answered on 07 Apr 2009, 11:08 AM
Hello Dario,

Since you are using 5.3.2 version of RadEditor for MOSS there is no need to overwrite the "Insert Table" command. What you can do is attach to the OnClientPasteHtml event. You can find example of the functionality in the following online demo of the RadEditor http://demos.telerik.com/aspnet-ajax/editor/examples/onclientpastehtml/defaultcs.aspx. There is additional information for the event in the following help article http://www.telerik.com/help/aspnet-ajax/onclientpastehtml.html.

What you should know is that since you are using RadEditor for MOSS, in order to attach to the OnClientPasetHtml event you need to follow these steps.
1. Modify the respective ConfigFile.xml or ListConfigFile.xml (for forms scenarios such as list, wiki, blog...), which are located in the Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\5.3.2.0__1f131a624888eeed\Resources folder.
For example add the following line.
<property name="OnClientPasteHtml">OnClientPasteHtml</property> 

2. Add the OnClientPaseHtml javascript methods in the MOSSEditorTools.js, which is located in the mentioned above folder.
For example.
function OnClientPasteHtml(sender, args) 
    //here you can get reference to the table and add the <thead> element 

I hope this helps.


Greetings,
Stanimir
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
WebParts for SharePoint
Asked by
Dario
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
Dario
Top achievements
Rank 1
Share this question
or