vitalets / angular-xeditable

Edit in place for AngularJS
http://vitalets.github.io/angular-xeditable
MIT License
1.91k stars 404 forks source link

Allow name attribute on checklist #770

Closed ckosloski closed 4 years ago

ckosloski commented 4 years ago

Allow name attribute on checklist

Fixes #769

ckosloski commented 4 years ago
1. I'm not sure if you want the name to be 'check_list[]' or just 'check_list' for 'data-e-name'. I checked the structure of editableForm, here is one of its attribute: $data: {name: "awesome", status: 2, group: 4}, I think 'check_list[]' is not a property name for the $data property.

2. It is expected that editableForm['check_list[]']['$viewValue'] to be an array, is there such test?
  1. That is just a name I used for the test to make sure it was added. It was from your example.
  2. I did not add a test to verify that the name exists on the element. I did however test in the browser console that document.getElementByName returned all 3 of the checkboxes.
sinall commented 4 years ago
1. I'm not sure if you want the name to be 'check_list[]' or just 'check_list' for 'data-e-name'. I checked the structure of editableForm, here is one of its attribute: $data: {name: "awesome", status: 2, group: 4}, I think 'check_list[]' is not a property name for the $data property.

2. It is expected that editableForm['check_list[]']['$viewValue'] to be an array, is there such test?
  1. That is just a name I used for the test to make sure it was added. It was from your example.
  2. I did not add a test to verify that the name exists on the element. I did however test in the browser console that document.getElementByName returned all 3 of the checkboxes.

If I specify 'check_list[]' as name, can I get editableForm['check_list[]']['$viewValue'] as values of selected checkboxes?

ckosloski commented 4 years ago

I did not try that. I only added support of the name, just like other controls support the name.

sinall commented 4 years ago

I did not try that. I only added support of the name, just like other controls support the name.

OK, the name part should be OK by your commit.

ckosloski commented 4 years ago

@eugef looks like you are good to merge.