single datasource for muiltiple mutiselect dropdown in angular - angularjs

I want to use Single Array as a Data-Source for Mutiple DropDown element(will be dynamic generated based on another ArrayList) with muti-select and condition begin when any item/'s get selected in any of the DDL, then it should be removed or disabled in the remaining DDL.
PS: I'm new to front end development and using Angular1.5 with TypeScript.
Ex:
DS for Select Option: [1,2,3,4,5,6,7,8]
I kind of facing problem when we are deselecting any item from the any of the DDL, since the deselected values needs to be pushed based to Available Values Array for the remaining DDL.

Maybe you should create an array of objects like [{value:1, disabled:false}, .....]
and work with the disable property.
should be something like:
<md-select ng-repeat="item in myItems">
<md-option
... ng-click="item.disabled = !item.disabled"></md-option>

Related

Dynamically populate angularjs-dropdown-multiselect with array of objects from mysql database

I'm using the angularjs-dropdown-multiselect.js to create a multi-select drop-down. I'm trying to dynamically populate the drop-down with existing data from mysql database. If I hardcode the array of objects in my scope, the drop-down is populated correctly and the glyphicon checks are highlighted, as being checked, and the correct numbers are selected. If I pass in the array of objects from the database, as a variable to the scope, the glyphicon checks are not highlighted next to the selected choices, but the correct number of selected is correct. Any ideas on how to fix this? Here is a link to the code I'm using: http://dotansimha.github.io/angularjs-dropdown-multiselect/#/.
In the backend, wherever you perform the query to get the array of items from the database, try making a loop that will go through the returned items, and push them into an array, one by one.
then make a get call that will receive array as a response from the database.
I hope this is what you work looking for!

Need a way to query MongoDB collection, and ngRepeat beginning at specific point

is there a way to query a MongoDB collection, return the results, use an AngularJS ng-repeat to iterate through the results, BUT BEGIN the iteration at a specific position in the results, somewhere in the middle for example?
I am currently returning a query to an angular view; a category of materials. Then i have my view set up to paginate(ng-repeat) through the results. However, no matter what material I click on to bring me into the view (from a different view), the ng-repeat always starts at the beginning of the materials list, rather than on the material i clicked. Any thoughts?
I do not believe the mongodb part has anything to do with the actual question but ill give you 2 options:
The quick way:
<div ng-repeat="item in items" ng-show="$index >= myCtrl.startPoint">
While this will do the trick you might want to do the ng-show expression with a filter. In addition you might run into performance issues. You should also use the track by feature.
A better way would be to have a filteredData model for the ng-repeat and do the correct filtering once per action. You would have to make sure yourself that the model is updated on every data change and every user input.
There are many choices in between these 2 options but what to use depends on your needs. For instance - does user input change frequently? Is your data updated frequently? etc.

Options on all Angular Chosen (plugin) select elements disappear when any are selected

Admittedly, I know just enough about Angular to be dangerous. However, I'm fairly certain I've followed the instructions for the plugin concisely.
The issue is: whenever I select any of the options from one of my select fields using the chosen plugin (City, Nationality, Hotel, Room Type...) the result never gets populated, and the results from all the other select fields disappear. I'm fairly certain this is user error on my part - any clarification or help is much appreciated.
You can see an example here: http://casamarelanoivas.com.br/sst/test/
Thanks.
Kyle
You are binding the selected value in your list to the same model variable you are using to generate the dropdown list. So whenever you select a value from the drop down list, you are wiping out the list values.
Here is what you have:
<select ng-model="model.cities" ng-options="city.name for city in model.cities">
This is the pattern you want to use instead.
<select ng-model="selectedCity" ng-options="city.name for city in model.cities">
In your controller you can then get the selected value from $scope.selectedCity

AngularJS - After Filtering The Model Isn't Updated

I just wanted to see if anyone has had experience with the issue I having. I am currently populating a select element from a restful web service using the ng-options feature and assigning it to my model with ng-model. I have also applied a filter to this select that changes the list based on the value from another select element. Everything works as intended from the display side. If I change the master select element and it filters the second select to not include the currently selected item, the display shows correctly and displays 'please select'. So this looks great and works as I intended but when this scenario happens the underlying model isn't updated and still has the invalid option stored in it. If I pass the model back to the server for further processing, I am getting values that might not be valid.
Does anyone have any ideas on how to have selected that filter one another also update the underlying model ?
I appreciate any ideas.

Classic ASP Update table with dynamic Checkbox values

I have two tables:
1) Holds a list of propertyTypes
2) Holds the propertyDetails
The user views the page and the list of propertyTypes are shown on screen - these are checkboxes that are pulled from propertyTypes and I have a repeat region around them to display them all.
The user can select a number of these propertyTypes and I want to be able to update the propertyDetails table with that information.
I have a varchar(max) field and want the data to go into there separated by commas. It may not be the best way, but the way we have opted for.
My issue, is how do I store the relevant ID's for each checkbox in that fields using Classic ASP?
I have bound the checkbox as follows so far, but it doesn't seem to work:
<input type="checkbox" name="propertyType" id="<%=(rsPropTypes.Fields.Item("ptID").Value)%>">
Any advice would be appreciated.
Thanks
Nick
try this.
myvalue=rsPropTypes.Fields.Item("ptID").Value
<input type="checkbox" name="propertyType" id="<%response.write(myvalue)%>">

Resources