This is a migrated thread and some comments may be shown as answers.

Can't get Grid custom editor to trigger

2 Answers 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 27 Mar 2012, 09:22 PM
I can't get the custom editor function : customEditor : to trigger.

<p>
  Rental - selector</p>
<div>
  <p>
    Mini class</p>
  <div id="rentalList">
  </div>
  <p>
    Compact class</p>
</div>
<div id="rentalList2">
</div>
<p>
  Select your car</p>
<script type="text/javascript">

  var cars = new kendo.data.DataSource({
    transport: {
      read: {
        url: '@Url.Action("GetCars")',
        dataType: "json"
      },
      update: {
        url: '@Url.Action("EditCars")',
        dataType: "json"
      }
    },
    schema: {
      model: {
        id: "CarSeq",
        fields: {
          CarModel: { editable: true },
           Name: { editable: true }
        }
      }
    }
  });


  function customEdit(container, options) {
    alert('function called');
  }


  $("#rentalList").kendoGrid({
    selectable: "row",
    height: 200,
    editable: true,
    dataSource: cars,
    columns: [
      { title: "Brand", field: "Name" },
      { title: "Model", field: "CarModel", editor: customEdit }
    ]
  });


  $("#rentalList2").kendoGrid({
    selectable: "row",
    height: 200,
    dataSource: carDataSource
  });

</script>

Can't see that anything is missing in the Kendo part of the javascript. Any clues why this won't trigger?

2 Answers, 1 is accepted

Sort by
0
hdp
Top achievements
Rank 1
answered on 28 Mar 2012, 04:23 PM
have you tried to replace that:

{ title: "Model", field: "CarModel", editor: customEdit } 

By:

{ title: "Model", field: "CarModel", editor: function(container, options) {  customEdit(container, options); } } 
0
Jason
Top achievements
Rank 1
answered on 10 Apr 2012, 09:36 PM
Replacing the kendo.all.min.js with the latest version of kendo.web.min.js solved my issue
Tags
Grid
Asked by
Jason
Top achievements
Rank 1
Answers by
hdp
Top achievements
Rank 1
Jason
Top achievements
Rank 1
Share this question
or