Author Topic: AddRow with html content  (Read 1943 times)

NearEarthObject

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 30
    • View Profile
AddRow with html content
« on: April 28, 2020, 06:58:34 pm »
Hi !
I am trying to add new row to a grid grammatically, usually It's pretty easy, but my entire colmodel are dataType html.


So the function is :



var rowIndx =  SpecificPricesGrid1.addRow({
       newRow: {
      from_quantity: '<input type="number" class="specificQuantity" value="0">',
      price_1: '<div class="input-flex"><div class="input-group-select"><select name="reduction_type" class="typeSelect" data-id="1" data-qty="0" id="typeSelect_1_0"><option value="amount">€</option><option value="percentage">%</option> </select><><input type="number" data-id="0" class="specificValue" id="specificValue_1_0" data-group="1" value="" ><>',
      price_2: '<div class="input-flex"><div class="input-group-select"><select name="reduction_type" class="typeSelect" data-id="2" data-qty="0" id="typeSelect_2_0"><option value="amount">€</option><option value="percentage">%</option> </select><><input type="number" data-id="0" class="specificValue" id="specificValue_2_0" data-group="2" value="" ><>',
      price_3: '<div class="input-flex"><div class="input-group-select"><select name="reduction_type" class="typeSelect" data-id="3" data-qty="0" id="typeSelect_3_0"><option value="amount">€</option><option value="percentage">%</option> </select><><input type="number" data-id="0" class="specificValue" id="specificValue_3_0" data-group="3" value="" ><>',
      price_4: '<div class="input-flex"><div class="input-group-select"><select name="reduction_type" class="typeSelect" data-id="4" data-qty="0" id="typeSelect_4_0"><option value="amount">€</option><option value="percentage">%</option> </select><><input type="number" data-id="0" class="specificValue" id="specificValue_4_0" data-group="4" value="" ><>',
      price_5: '<div class="input-flex"><div class="input-group-select"><select name="reduction_type" class="typeSelect" data-id="5" data-qty="0" id="typeSelect_5_0"><option value="amount">€</option><option value="percentage">%</option> </select><><input type="number" data-id="0" class="specificValue" id="specificValue_5_0" data-group="5" value="" ><>',
      price_6: '<div class="input-flex"><div class="input-group-select"><select name="reduction_type" class="typeSelect" data-id="6" data-qty="0" id="typeSelect_6_0"><option value="amount">€</option><option value="percentage">%</option> </select><><input type="number" data-id="0" class="specificValue" id="specificValue_6_0" data-group="6" value="" ><>',
      price_7: '<div class="input-flex"><div class="input-group-select"><select name="reduction_type" class="typeSelect" data-id="7" data-qty="0" id="typeSelect_7_0"><option value="amount">€</option><option value="percentage">%</option> </select><><input type="number" data-id="0" class="specificValue" id="specificValue_7_0" data-group="7" value="" ><>',
      price_8: '<div class="input-flex"><div class="input-group-select"><select name="reduction_type" class="typeSelect" data-id="8" data-qty="0" id="typeSelect_8_0"><option value="amount">€</option><option value="percentage">%</option> </select><><input type="number" data-id="0" class="specificValue" id="specificValue_8_0" data-group="8" value="" ><>',
      price_9: '<div class="input-flex"><div class="input-group-select"><select name="reduction_type" class="typeSelect" data-id="9" data-qty="0" id="typeSelect_9_0"><option value="amount">€</option><option value="percentage">%</option> </select><><input type="number" data-id="0" class="specificValue" id="specificValue_9_0" data-group="9" value="" ><>',
                     }
});


The new row appears as expected, but content html of each cell is simply empty.


Any idea what's going wrong ??


Thanks in advance


Jeff

NearEarthObject

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 30
    • View Profile
Re: AddRow with html content
« Reply #1 on: April 28, 2020, 07:08:37 pm »
I found the solution !
as this relay to html content, ColModel editble was turn to false, so I add checkEditable: false and all is coming properly !