Sujeet Raman

Sujeet Raman

  • 737
  • 915
  • 333.3k

How to get gridrow values on the textbox for edit Angular 2

May 9 2017 7:18 AM
i have a table grid with binded values. i need to edit and update that value .for that i ve given chek boxes,the selected chekbox row should bind the textbox to edit.based on id how i can do this? in that 2 dropdowns are there how i can edit this way in angular 2
the textboxes should able to submit and edit
  1. <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 popup-content">  
  2. <div>  
  3. <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 popup-firstcontent">  
  4. <div style="width: 25%; float:left">  
  5. <div class="flexibleColumn" style="position:relative;left:5px;top:2px;">  
  6. <label>Type :</label>  
  7. <select id="selection1" class="form-control" [(ngModel)]="type">  
  8. <option *ngFor="let Dropdowns of dropdown" value= {{Dropdowns.ID}}>  
  9. {{Dropdowns.Name}}  
  10. </select>  
  11. </div>  
  12. </div>  
  13. </div>  
  14. <div class=" popup-input">  
  15. <label>Value :</label>  
  16. <input type="text" [(ngModel)]="Value" value="" class="inputbox" id="textbox_id2">  
  17. </div>  
  18. <div style="width: 5%; float:left">  
  19. <div class="flexibleColumn" style="position:relative;left:5px;top:2px;">  
  20. <label>Unit</label>  
  21. <select id="selection1" class="form-control" [(ngModel)]="Unit">  
  22. <option *ngFor="let Dropdowns of dropdown2" value= {{Dropdowns.VD_ID}}>  
  23. {{Dropdowns.VDName}}  
  24. </select>  
  25. </div>  
  26. </div>  
  27. <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 popup-secondcontent" >  
  28. <div class="popup-input">  
  29. <label>Variable Name :</label>  
  30. <input type="text" [(ngModel)]="VariableName" class="inputbox" id="textbox_id1">  
  31. </div>  
  32. <div class="popup-input">  
  33. <label>Is Lookup Variable :</label>  
  34. <div class="styled-select" id="textbox_id5">  
  35. <select id="selection1" [(ngModel)]="IsLookupVariable" >  
  36. <option selected="selected">Yes</option>  
  37. <option [ngValue]="">No</option>  
  38. <option [ngValue]=""></option>  
  39. </select>  
  40. </div>  
  41. </div>  
  42. </div>  
  43. </div>  
  44. </div>  
  45. <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 container-btn" style="float:center">  
  46. <button class="add-popup" (click)=" SaveVariableValues(Id, VariableName,IsLookupVariable,Unit,Value,VariableType,VariableTypeID,UnitId,MV_ID)" >Add Variable</button>  
  47. <button class="add-popup">Change</button>  
  48. <button>Remove</button> <button>View Lookup</button></div>  
  49. <div class="table1">  
  50. <table id="myTable" class="col-lg-10 col-md-10 col-sm-10 col-xs-10 accordion-table">  
  51. <thead>  
  52. <tr><th> </th><th>Variable Type</th><th>Value</th><th>Unit</th><th>Variable Name</th><th>Is Lookup Variable</th></tr>  
  53. </thead>  
  54. <tbody>  
  55. <tr *ngFor="let Variables of grid">  
  56. <td>  
  57. <span class="custom-checkbox"><input id="first" name="sport[]" type="checkbox" [checked]="isChecked" /></span>  
  58. </td>  
  59. <td>  
  60. {{ Variables.Type}}  
  61. </td>  
  62. <td>{{ Variables.Value}}</td>  
  63. <td>{{ Variables.Unit}}</td>  
  64. <td>{{ Variables.Name}}</td>  
  65. <td>{{ Variables.Variable}}</td>  
  66. </tr>  
  67. </tbody>  
  68. </table>  
  69. </div>  

Answers (1)