javascript - Grid data disappears when columns are grouped -
javascript - Grid data disappears when columns are grouped -
i'm using kendo grid display inline editable list of events within of angularjs directive. info loading , displaying expected , seems working correctly. able sort, edit, update, , delete info , works perfectly.
when effort grouping column, info disappears. grouping headers appear correctly right info of rows show empty. edit , delete buttons in place each row should have data. can click delete , remove empty row. if edit button clicked text boxes appear right info loaded service. if update info , click update, returns beingness invisible.
can see i'm doing wrong?
here special-events.directive.js:
(function() { 'use strict'; angular .module('app') .directive('specialevents', [specialevents]); function specialevents () { var directive = { restrict: 'ea', link: link, templateurl: 'app/components/special-events/special-events.html', controller: specialeventsctrl, controlleras: 'specialeventsvm', scope: { source: '=' } }; homecoming directive; function link(scope, element, attrs) { } /* directive controller */ function specialeventsctrl($scope, $http){ var vm = this; var id = 0; vm.source = new kendo.data.datasource({ transport: { read: function(options) { $http.get('http://localhost:8181/ping').then(function(response) { id = response.data.length; vm.griddata = response.data; options.success(response.data); }); }, update: function(options) { options.success(options.data.models[0]); console.log(options.data.models[0]); }, destroy: function(options) { options.success(options.data.models[0]); console.log('row #' + options.data.models[0].id + ' deleted'); }, create: function(options) { id++; options.data.models[0].id = id; options.success(options.data.models[0]); console.log('added ' + options.data.models[0] + ' id of ' + options.data.models[0].id); } }, batch: true, pagesize: 10, schema: { model: { id: 'id', fields: { id: {editable: false, type: 'number'}, eventname: { type: 'string' }, description: { type: 'string' }, dates: { type: 'string' }, } } } }); } } })();
and here special-events.html
<div id="grid" kendo-grid k-data-source="specialeventsvm.source" k-height="350" k-groupable="true" k-sortable="true" k-pageable="{ refresh: true, pagesizes: true, buttoncount: 5 }" k-columns="[{ field: 'eventname', title: 'event name', width: 200 }, { field: 'description', title: 'description' }, { field: 'dates', title: 'dates' }, { command: ['edit', 'destroy'] }]" k-editable="{'mode': 'inline', 'create': true, 'update': true, 'destroy': true}" k-toolbar="['create']" ></div>
and here data:
var info = [ {id: 1, eventname: 'wedding', description: 'people getting married', dates: '11/02/2014 - 11/03/2015' }, {id: 2, eventname: 'wedding', description: 'people getting married', dates: '11/02/2014 - 11/03/2015' }, {id: 3, eventname: 'wedding', description: 'people getting married', dates: '11/02/2014 - 11/03/2015' }, {id: 4, eventname: 'wedding', description: 'people getting married', dates: '11/02/2014 - 11/03/2015' }, {id: 5, eventname: 'wedding', description: 'people getting married', dates: '11/02/2014 - 11/03/2015' }, {id: 6, eventname: 'wedding', description: 'people getting married', dates: '11/02/2014 - 11/03/2015' }, {id: 7, eventname: 'wedding', description: 'people getting married', dates: '11/02/2014 - 11/03/2015' }, {id: 8, eventname: 'wedding', description: 'people getting married', dates: '11/02/2014 - 11/03/2015' }, {id: 9, eventname: 'wedding', description: 'people getting married', dates: '11/02/2014 - 11/03/2015' }, {id: 10, eventname: 'wedding', description: 'people getting married', dates: '11/02/2014 - 11/03/2015' }, {id: 11, eventname: 'wedding', description: 'people getting married', dates: '11/02/2014 - 11/03/2015' }, {id: 12, eventname: 'wedding', description: 'people getting married', dates: '11/02/2014 - 11/03/2015' }, {id: 13, eventname: 'wedding', description: 'people getting married', dates: '11/02/2014 - 11/03/2015' }, {id: 14, eventname: 'wedding', description: 'people getting married', dates: '11/02/2014 - 11/03/2015' }, {id: 15, eventname: 'wedding', description: 'people getting married', dates: '11/02/2014 - 11/03/2015' }, {id: 16, eventname: 'wedding', description: 'people getting married', dates: '11/02/2014 - 11/03/2015' } ];
i had similar issue grouping functioned exact same way have described. using kendoui angularjs appears are. able prepare issue upgrading telerik.kendoui.professional.2014.3.1119.commercial older commercial version. seems must have been bug kendo, haven't been able find definitive in docs it. cost me few hours or work trying figure out doing wrong.
====== update in future encounters this: bug datasource in kendoui when used angular. http://www.telerik.com/support/whats-new/kendo-ui/release-history/q2-2014-sp1
javascript angularjs angularjs-directive kendo-grid
Comments
Post a Comment