File tree Expand file tree Collapse file tree 3 files changed +41
-0
lines changed
styles/web/Default/listview Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -748,6 +748,8 @@ var __meta__ = { // jshint ignore:line
748748 var that = this ;
749749 var dataSource = that . dataSource ;
750750 var dataItem = that . dataItem ( item ) ;
751+ var transport = dataSource . transport ;
752+
751753 if ( ! dataItem || ! dataSource ) {
752754 return ;
753755 }
@@ -762,6 +764,10 @@ var __meta__ = { // jshint ignore:line
762764 }
763765 } else {
764766 dataSource . remove ( dataItem ) ;
767+ if ( transport && ( transport . destroy || ( transport . options || { } ) . destroy ) &&
768+ ( ! dataItem . isNew || ! dataItem . isNew ( ) ) ) {
769+ dataSource . _destroyed . push ( dataItem ) ;
770+ }
765771 }
766772 that . _removeElement ( item ) ;
767773 } ,
Original file line number Diff line number Diff line change 4646 flex : 1 1 auto ;
4747 align-content : flex-start ;
4848 position : relative ;
49+ overflow : auto ;
4950
5051 & ::after {
5152 height : 0 ;
Original file line number Diff line number Diff line change 2525 var SELECTED_STATE_CLASS = "k-state-selected" ;
2626 var DOT = "." ;
2727
28+ function createListBoxCRUD ( options , html ) {
29+ var listbox = createListBoxFromHtml ( html , $ . extend ( {
30+ dataSource : {
31+ transport : {
32+ read : function ( e ) {
33+ e . success ( dataItems ) ;
34+ } ,
35+ destroy : $ . noop ,
36+ create : $ . noop ,
37+ update : $ . noop
38+ }
39+ } ,
40+ dataTextField : "text"
41+ } , options || { } ) ) ;
42+
43+ return listbox ;
44+ }
45+
2846 function createListBox ( options , html ) {
2947 var listbox = createListBoxFromHtml ( html , $ . extend ( {
3048 dataSource : {
185203 } ) ;
186204 } ) ;
187205
206+ describe ( "ListBox api" , function ( ) {
207+ beforeEach ( function ( ) {
208+ listbox = createListBoxCRUD ( ) ;
209+ } ) ;
210+ afterEach ( function ( ) {
211+ destroyListBox ( listbox ) ;
212+ kendo . destroy ( Mocha . fixture ) ;
213+ } ) ;
214+
215+ it ( "removing item pushes it in the destroyed collection" , function ( ) {
216+ listbox . remove ( FIRST_ITEM_SELECTOR ) ;
217+
218+ assert . equal ( listbox . dataSource . _destroyed . length , 1 ) ;
219+ } ) ;
220+ } ) ;
221+
188222 describe ( "ListBox api" , function ( ) {
189223 beforeEach ( function ( ) {
190224 listbox = createListBox ( ) ;
You can’t perform that action at this time.
0 commit comments