将RTE与JQGrid集成
我正在使用事件的内联编辑。点击一个不可编辑的单元格,我想打开富文本框。我尝试使用edittype:custom并返回rte,但没有显示任何内容。有没有其他方法可以做到这一点将RTE与JQGrid集成,jqgrid,inline-editing,rte,Jqgrid,Inline Editing,Rte,我正在使用事件的内联编辑。点击一个不可编辑的单元格,我想打开富文本框。我尝试使用edittype:custom并返回rte,但没有显示任何内容。有没有其他方法可以做到这一点 <script language="javascript" type="text/javascript"> writeRichText("rte0", "rte0", 575, 200, true, false, "Notes");
<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>
请建议
<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>
谢谢,
Arshya使用
edittype:custom
对于不可编辑的列没有任何意义。通过使用editable:true
使列可编辑,我可以使用下面的解决方案实现这一点
<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>
加载完成后,我添加了代码以在单元格单击时打开div
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;
<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>
loadComplete:function(){
var iColNotesPresent=getColumnIndexByName($(this),'NotesPresent'),rows=this.rows,i,c=rows.length;
var iColNotes=getColumnIndexByName($(此),'Notes');
对于(i=1;i
}
<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>
下面是RTE的html代码
<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>
书面文本(“rte0”,“rte0”,575200,真,假,“注释”);