Author Topic: grid cell image  (Read 4064 times)

jomeihua

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 7
    • View Profile
grid cell image
« on: February 13, 2014, 07:01:38 am »

I have image and data in one cell.
        render: function(ui){
        var rowData = ui.rowData;
         return "<button type='button' class='search_btn'></button>"+rowData['division'];
   },
question1) I should see the image in edit mode
question2) Modify existing data, the image is not visible and cell data is readonly

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6296
    • View Profile
Re: grid cell image
« Reply #1 on: February 13, 2014, 09:31:37 am »
If you want to view image while editing, use editor: { type: 'contenteditable' } or a custom rich text editor like TinyMCE. You would have to implement callback function in editor to integrate rich text editor.

API: http://paramquery.com/pro/api#option-column-editor

Example of image in contenteditable:

http://paramquery.com/pro/demos/grid_xml


2) You can hide the image from view either by using render callback or by not keeping <img> tag in the cellData.

3) Cell can be make readonly by use of API
http://paramquery.com/pro/api#option-column-editable