Capturing the updated content from text are in JSON variable

前端 未结 1 482
名媛妹妹
名媛妹妹 2021-01-27 18:53



        
相关标签:
1条回答
  • 2021-01-27 19:15

    Looking at gridster's docs, you can add a serialize_params to your gridster initialization to customize what the serialization does.

    You can then add a value field that will get serialized as $w.find(':input').val() which retrieves the up-to-date value of the input field within each cell of the grid.

    gridster = $('.gridster ul').gridster({
      widget_base_dimensions: [100, 55],
      widget_margins: [5, 5],
      serialize_params: function($w, wgd) { 
        return { 
          value: $w.find(':input').val(), 
          col: wgd.col, 
          row: wgd.row, 
          size_x: wgd.size_x, 
          size_y: wgd.size_y 
        } 
      }
    }).data('gridster');
    

    Fiddle Demo

    0 讨论(0)
提交回复
热议问题