Question

I am using inline editing with events. And on click of a non editable cell I want to open Rich Text Box. I tried using edittype: custom and returning the rte but nothing displays. Is there any other way to do this.

Please suggest!

Thanks, Arshya

Was it helpful?

Solution 2

I was able to achieve this using the below solution

On load complete I added the code to open the div on cell click

loadComplete: function() {
        var iColNotesPresent = getColumnIndexByName($(this), 'NotesPresent'), rows = this.rows, i, c = rows.length;
        var iColNotes = getColumnIndexByName($(this), 'Notes');

        for (i = 1; i < c; i += 1) {
            $(rows[i].cells[iColNotesPresent]).click(function(e) {
                var offset = jQuery(e.target).offset();
                var rteText = $(jQuery(e.target).parent()[0].cells[iColNotes])[0].outerText;
                var rowId = jQuery(e.target).parent()[0].id;
                OpenRTEBox(offset, rteText, rowId);
            });
        }
    },

//Open the div containing RTE 
function OpenRTEBox(offset, rteText, rowId) {

isColNotes = true;
currsel = rowId;  

$('#rteDiv').css({ position: "absolute", top: offset.top, left: offset.left, "z-index": 20 });
$('#rteDiv').show();

frames['rte0'].document.body.innerHTML = rteText;    

}

Here is the html code for RTE

                <script language="javascript" type="text/javascript">
                    writeRichText("rte0", "rte0", 575, 200, true, false, "Notes");
                </script>

            </td>
        </tr>
        <tr>
            <td align="right">
                <input type="button" id="btnOK" onclick="addNotes();" value="OK"/>
            </td>
            <td align="left">
                <input type="button" id="btnCancel" onclick="closeDiv();" value="Cancel"/>
            </td>
        </tr>
    </table>
</div>

OTHER TIPS

using edittype: custom makes no sense for a non-editable column. Make the column editable, by using editable: true

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top