【问题标题】:Integrate RTE with JQGrid将 RTE 与 JQGrid 集成
【发布时间】:2013-04-25 10:51:28
【问题描述】:

我正在对事件使用内联编辑。单击不可编辑的单元格时,我想打开富文本框。我尝试使用 edittype: custom 并返回 rte 但没有显示。有没有其他方法可以做到这一点。

请推荐!

谢谢, 阿夏

【问题讨论】:

    标签: jqgrid inline-editing rte


    【解决方案1】:

    使用edittype: custom 对不可编辑的列毫无意义。使用editable: true使列可编辑

    【讨论】:

      【解决方案2】:

      我能够使用以下解决方案实现这一目标

      加载完成后,我添加了代码以在单元格单击时打开 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;    
      

      }

      这是 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>
      

      【讨论】:

        猜你喜欢
        • 2010-11-29
        • 1970-01-01
        • 2011-11-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-02-01
        相关资源
        最近更新 更多