ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

editableCellTemplate date filter not working

Open JZehet opened this issue 11 years ago • 4 comments

I try to use a editableCellTemplate like the following:

<div><form name=\"inputForm\"><input type=\"date\" ng-class=\"'colt' + col.uid\" ui-grid-editor ng-model=\"MODEL_COL_FIELD\" ></form></div>

With that everthing works fine. When i now add a date filter like:

<div><form name=\"inputForm\"><input type=\"date\" ng-class=\"'colt' + col.uid\" ui-grid-editor ng-model=\"MODEL_COL_FIELD | date:\'dd.MM.yyyy\'\" ></form></div>

i receive a angular "nonassign" error:

Error: [ngModel:nonassign] http://errors.angularjs.org/1.4.7/ngModel/nonassign?p0=row.entity%5B'tbl_bestellung_datum_lieferung'%5D%20%7C%20date%3A'dd.MM.yyyy'&p1=%3Cinput%20class%3D%22ng-pristine%20ng-untouched%20ng-valid%20ng-scope%22%20type%3D%22date%22%20ng-model%3D%22row.entity%5B'tbl_bestellung_datum_lieferung'%5D%20%7C%20date%3A'dd.MM.yyyy'%22%20ng-class%3D%22'colt'%20%2B%20col.uid%22%20ui-grid-editor%3D%22%22%3E at $$setOptions ........... 

What can i try ? Thanks

JZehet avatar Nov 05 '15 13:11 JZehet

Can you reproduce it in a plunker?

imbalind avatar Nov 05 '15 19:11 imbalind

Yes i can reproduce it with the following example:

http://plnkr.co/edit/2V9MFE?p=info

The failing template is active in the code. Please enter the date column "registered".

JZehet avatar Nov 06 '15 09:11 JZehet

Ok, you are simply not allowed to use filter in input fields. It's a angular thing, see here for a possible workaround.

I'm closing this.

imbalind avatar Nov 06 '15 18:11 imbalind

Oh sorry, many thanks. Next time i will do more research.

JZehet avatar Nov 09 '15 09:11 JZehet