Checkbox are getting unchecked if they are of same ng-model AngularJS - angularjs

i have a scenario.
suppose i do have two pages view 1 and view 2.
and i have three values A,B,C by which i can compare the checkbox on both views.
now on view 1 there is a checkbox with value A,B,C.
and on view 2 there are values "A,B,C" , "A,B,C1" , "A,B,C2".
these values are bind with checkbox on both views.
means on view 1 there is a checkbox with value A,B,C and if we click on button against that checkbox it will show us the multiple values on view 2.
i have put same ng-model for both checkbox lists.
so that if i click on view one then the c on view will be check on view 2 also.
but if i uncheck c valued checkbox on view 2 then the checkbox of view 1 is also unchecked. and user think that nothing is seleted.
i want to show something on that inner values are checked for that checkbox on view 1.
is there any solution to this? i am using ionic, AngularJS
Please help
thank you.

Related

How to set dropdown values to null using ng-change angular js?

I have one dropdown lets say Drop-down A, based on option selected from that, new dropdowns will be populated. For example,on selection of option 1 from Drop-down A, 2 new dropdowns will be showed. similarly on selection of other options new dropdowns will be populated and other dropdowns will be removed.
Now when I select options from newly populated dropdowns,I can get their value.
Problem comes when I select option 1 from Drop-down A and then select values from newly generated dropdowns, but now I wish to change Drop-down A slection to option 2. Now based on current selection, new dropdowns will be generated.
So if now I post the values, my controller still shows, previous option 1 values.
So how can I change unselected dropdown values to null?
See Plunker
If I understand you problem right, I would prefer to create a function in controller to reset object.
$scope.onChange = function(){
$scope.obj = {};
}
And call it on ng-change
<select ng-model="selectC" ng-change="onChange()" name="subSub" id="main">
Wokring plunker

How to remove checkbox selection from all views in checkbox selection model in EXT grid

I have a Ext grid with checkbox selection Model. The grid contains multiple pages of 50 records each. I have a 'Clear Selections' button to deselect all the selected rows in the selection model.
The code for this is :
handler: function(){
this.selectionModel.deselectAll();
this.selectedReordsArray.clear();
},
scope: this
The problem is, when I select some records in the first page and move to second page and select some records there as well. Now if I click 'Clear Selections' button it deselects the rows on that page i.e. second page , but when I go back to page 1 , the rows there are still selected.
Is there any way to remove checkbox selections from all the pages.
Thanks,
PS : I am using Ext JS 4.1.3
Add "pruneRemoved: false" for your selmodel. Then try adding deselectAll() method for your gridstore. This will clear selected records from all pages.

Limit data based on UniqueCount

I have charts on a tab, that should only show if 1 value from a column filter is selected.
For example if a field named: BUSINESS_UNIT has values of "HR","FIN","IT" The charts should only show data if 1 value is filtered on. Such as "HR."
These charts do not contain the BUSINESS_UNIT field itself.
I tried using the Limit Data Using expression, but for some reason the limit expression UniqueCount(BUSINESS_UNIT)=1 doesn't work.
How would I hide the data in the charts, unless 1 BUSINESS_UNIT is selected?
What you could do is hide the filters panel and create radio buttons on a new text area for each property to mark data. If you need help setting this up let me know. Then in your visualisations limit data using markings and show an empty visualisation if no items are marked.
One downside to this is maintenance, if the values change you will have to update the UI.
Another possible solution (untested) is to change the filter panel properties from checkboxes to radio buttons.
Filter Panel Properties:
http://stn.spotfire.com/spotfire_client_help/filter/filter_panel_properties.htm
You want it to look something like this:
http://stn.spotfire.com/spotfire_client_help/filter/filter_radio_buttons.htm

Include text between check boxes in a check box group?

Anyone know if there's a way to include some text between check boxes in a check box group in XPages? What I'd like to do is implement something like this with a single check box group:
Explanation about these checkboxes:
- Checkbox 1
- Checkbox 2
Explanation about these checkboxes:
- Checkbox 3
- Checkbox 4
I'm pretty sure there isn't an easy solution to this using the CheckboxGroup control. You'll have to build it one checkbox at a time.
You will need to have multiple checkbox groups, then on an onchange you can change the value of another group to null.

Odd ng-model Behavior with nested checkboxes

Ok, so here is a Plunker http://plnkr.co/edit/p7eJFTdsk9CFXwEIXZyb of the behavior that I am experiencing. I have tried to use the same ng-model on all levels but that also displays odd behavior and this is the closest I have gotten to what I am actually trying to accomplish.
I would like the toplevel checkbox to work like the sublist1 checkboxes.
Steps to create unwanted behavior:
click top level checkbox for item 1
click top level checkbox for item 1 again, so far works as expected.
click sub level item 2.1 checkbox this works. However the Top Level Item 1 checkbox will no longer change the item 2.1 checkbox.
Because each ng-repeat creates a new scope, once a deep scope is manipulated to have it's own properties, it will no longer inherit from higher level scope.
This is expected.
Check out a question on my profile regarding scope and ng-repeat.

Resources