javascript - Angular.js ngTable select input as a column not showing the existing value -
I am using Angular.js 1.2 and I am trying to select an input in a ngtables cell . Popups the option list but ngModel does not select the item to display instructions.
This is what my desk looks like at this time:
& lt; Table class = "col-xs-12 table" data-ng-table & gt; & Lt; Tr data-ng-repeat = "task in template.tasks" & gt; & Lt; Td data-title = "'category'" & gt; & Lt; Class = "form-control template-work-category" data-ng-model = "function.categoryId" data-ng-option = "category for category category, track category categories according to category" & gt; & Lt; / Select & gt; & Lt; / TD & gt; & Lt; Td data-title = "'description'" & gt; & Lt; Input class = "form-control template-work-center-center-block" data-ng-model = "workdescription" /> & Lt; / TD & gt; & Lt; Td data-title = "'default role' '& gt; & lt; class =" form-control "data-ng-model =" task.defaultRoleId "data-ng-option =" role For Role in Role Roles by Role.id. "& Gt; gt; & lt; / td & gt; & lt; td Data-Title =" 'Est Hour "" & gt; & quot; Input class = "form-control template-work-hour center-block" data-ng-model = "Task. Stated Hors" /> gt; & lt; / td & gt; Lt; td data-title = "command" "& gt; & Lt; Input class = "form-control template-work-sort center-block" data-ng-model = "task sort order" /> & Lt; / TD & gt; & Lt; Td data-title = "'remove' '& gt; & lt; a href =" # "class =" glyphicon-glyphin-extract "onclick =" return false; "data-ng-click =" removeTask (function) " & Gt; & lt; / a & gt; & lt; / TD & gt; & lt; / tr & gt; & lt; / table & gt; Category and default role Columns are always shown as non-selected dropdowns, and when I display task.categoryId and task.defaultRoleId directly they have values that are listed in the Options list Are the part Here's something to do? Edit Here's an example. What is the expected value for the dropdown selected?
I thought it. The NG-model needs to point to a complete example of the related object, and not The property containing the ID. In my class I had both an ID field (the copy of the database table) and the associated example. Binding Dahrn (task.taskCategory instead task.categoryId) was fixed.
Comments
Post a Comment