w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
AngularJS: filter a dropdown directive
I found the solution, just add filter:keywordType in the directive template. this is the update link <select ng-model="supplierId" ng-options="a[optValue] as a[optDescription] for a in array | filter: keywordType" required>'

Categories : Javascript

angularjs ng-grid dropdown not working with order by
Ok, found the issue. To reference the original object you need to change AnimalData[ row.rowIndex ].type to row.entity.myEditableProperty.type eg: <div><select ng-model="row.entity.myEditableProperty.type" ng-options="item for item in types"></select></div> Proof of concept Plunkr: http://plnkr.co/edit/i7vXng?p=preview

Categories : Javascript

angularjs filter (not working)
Assuming that you'd like to filter in catalogs using distributor name then the following custom filter does the job: <div data-ng-controller="dashboard_controller"> <h1> Catalogs <input type="text" data-ng-model="catalog_filter" placeholder="Filter Distributors"> </h1> <div class="catalogs_listing"> <ul data-ng-repeat="catalog in catalogs | distributorName: catalog_filter:distributors"> <li> <a href="{{catalog.distributor_id}}/d/products/catalog_view/{{catalog.uid}}"> <div class="catalog_thumb"> <div class="catalog_thumb_image"> <span>demo - no image</span> </div> </div>

Categories : Javascript

AngularJs: Searching using filter option is not working properly
You can use object instead of String for the key. See: http://docs.angularjs.org/api/ng.filter:filter <input type="text" ng-model="nameFilter.contactName" placeholder="Enter a name here">

Categories : Angularjs

Codeigniter Form dropdown filter function using ajax, loads page very slow in dropdown onchange event
Considering the number of HTML contents being passed using Ajax it will really slows the loading of the content of the div. Better way to speed it up is to lessen the number of codes to be passed using ajax.

Categories : Javascript

Angularjs ng-repeat custom filter breaks orderBy filter?
You are currently exposing an object to orderBy, this should probably be an array. Try replacing return tags; at the end of your uniqueTickers filter with the following: var arr = []; for (var ticker in tags) { arr.push(tags[ticker]); } return arr;

Categories : Javascript

AngularJS multiple filter with custom filter function
Try this: <tr ng-repeat="player in players | filter:{id: player_id, name:player_name} | filter:ageFilter"> $scope.ageFilter = function (player) { return (player.age > $scope.min_age && player.age < $scope.max_age); }

Categories : Javascript

using jquery how do I filter a dropdown field based on value selected from another dropdown field
Using AJAX is a great way to do what you are asking. Please forgive me if you already know this but in jQuery/javascript, you: grab the value of the first select box use AJAX code to send that to a secondary PHP file, which uses the data it receives to write some HTML code based on what the user chose the newly constructed HTML is ECHOed back to the ajax routine, where it is received inside a success function Inside the success function, you can use jQuery to replace the contents of the second dropdown Here is a detailed example, with explanations

Categories : Jquery

MVC4 Cascading dropdown list just working for 2 dropdown lists and not for more than that
I just moved the two onchange functions (other than firstone) to other views, which load my dropdowns. Actually it was a post back issue, so on single view Change for more than one "ddl" was not fired. Moving it to Partial Views did the trick

Categories : Jquery

filter data using dropdown?
First and foremost, your select values are ambiguous. They contain values that can filter AND sort the entries - Separate the two since they are two different functionality. Next, you need to define a custom Filter which will filter the data based on the rating selected. For this, you enhance the filtering criteria with the "Rating" property to associate the rating selected with a rating value. Finally, associate the sorting with a predicate and a reverse value - the predicate determines the property / column to determine for the sort (price in your case) while the reverse determines the ascending / descending nature of the sort. The entire code can be found here - http://plnkr.co/edit/n7TebC?p=preview I have updated the plunkr and introduced comments so let me know if you do not u

Categories : Angularjs

Is there a way to filter on categories via dropdown using jquery FastLiveFilter?
Here you go just call this script $('#category_id').fastLiveFilter('#search_list'); <select id="category_id"> <option value="">select</option> <option value="t">t</option> <option value="S">S</option> </select> #search_list is the id of your container in which your records are I have test it on the demos site of this plugin and it is working perfectly See Fiddle i have created for you

Categories : Jquery

Is there a way to filter the typeahead.js selections right before opening the dropdown?
I suppose you could use remote (making an AJAX call) and pass your document data to the server side, and have the server side populate. A hack is immediately implied: Use prefetch, and in its filter store a reference to the data. Have the filter() itself return an empty set. Have an empty remote URL (or a URL that points to an endpoint that does nothing), and in its filter, read the data that you stored in prefetch's filter, do whatever you want with your document data, and return any subset of that.

Categories : Javascript

Wordpress query_posts category dropdown filter
Something like this should do what you need. $args = array(); if (!empty($_GET['operation'])) $args[] = $_GET['operation']; if (!empty($_GET['type'])) $args[] = $_GET['type']; if (!empty($args)) query_posts( array('category__and'=>$args)); else query_posts();

Categories : PHP

How to filter page content according to dropdown box selection in cakephp 2.x
In order to achieve those results you should follow the next steps: Create an action that returns the content with $this->layout = null Create a view for this action that displays the content in the way you desire (html with no css) In the view that you like to fetch that content through AJAX make a request that pulls that controller and view append it where you want it on your page (with proper css on the page you make the request it will display correctly)

Categories : Ajax

How can I filter my searchresults with multiple filters? (dropdown, keywords etc)
Here is the simple example i have created for you hope it gives you the idea that you are trying to implement Consider this html that contains the ul li structure with two search fields <ul> <li>bob bope</li> <li>bob test</li> <li>bob bones</li> <li>bob bobs</li> <li>test mcBridge</li> </ul> <br> Search: <input id="search" class="search" length="24" /> Refine <input id="refine" class="search" length="24" /> And here is the jquery which searches as well as refines the results considering the values of both text fields $(document).ready(function(){ $(".search").keyup(function(){ $("li").hide(); if($("#refine").val()!=""){ var term = $("#search").v

Categories : PHP

Filter dropdown on edit view in Sonata Admin Bundle
You can have several options: You can use $formMapper->add('invoice', 'sonata_type_model_list'); which will give you a nice widget for selecting an invoice to associate. You can use GenemuFormBundle to display Select2 library widgets. Very easy to integrate. Just use genemu_jqueryselect2_entity type and set class attribute to your entity.

Categories : Misc

How can I add to my table filter to allow for multiple checkbox selections, as well as filtering from a dropdown?
Since you know the problem, ill skip the explication and jump to the solution. Use the .filter() method mixed with an array. Instead of expending a string, push the class name into an array : var classes = []; $("input[name='filterStatus']").each(function() { if ($(this).is(":checked")) { classes.push('.'+$(this).val()); } }); Then when selecting the row, use .filter() just like that : rows = $("#StatusTable tr" + stateClass).filter(classes.length ? classes.join(',') : '*') Then everything work fine! Fiddle

Categories : Javascript

Set an AngularJS date filter format to be used by all references to the date filter?
The format defaults to mediumDate if none is provided. There is nothing built in to have it default to something else. https://github.com/angular/angular.js/blob/master/src/ng/filter/filters.js#L382

Categories : Angularjs

jQuery Tablesorter 2.10.8 - Dropdown Filter Breaks with Scroller Widget Enabled
The $.tablesorter.getFilters() method doesn't know to look in the duplicated scroller header (created by the scroller widget), so that's why it doesn't work as you expect. I guess you could call it a bug, since the getFilters() function isn't smart enough to check for duplicate headers. I went ahead and added an issue, so I'll remember to fix it once I return from my sabbitcal.

Categories : Jquery

Adding and removing nodes and links from force diagram in d3 based on filter dropdown
In your update code you should be reselecting the existing nodes before doing a data bind with the new data. In the current code you're using the variables circle and path which are actually referring to the newly appended nodes of the enter selection. Reselecting before every data join is the best way to ensure you are joining with the very latest actual state in the DOM: svg.selectAll("path") .data(force.links()); svg.selectAll("circle") .data(force.nodes()); It is probably a good idea for you to class your circles and paths in some way that will let you select for them more directly so you don't accidentally pick up other paths or circles in the svg. Also, be careful about operating on the enter selection versus the update selection. This is especially true considering th

Categories : Javascript

Filter is not working if filter name contains "(" and ")" in Solr
Lucene supports escaping special characters that are part of the query syntax. The current list special characters are && || ! ( ) { } [ ] ^ " ~ * ? : To escape these character use the before the character. For example to search for (1+1):2 use the query: (1+1):2 Source - http://lucene.apache.org/core/2_9_4/queryparsersyntax.html#Escaping Special Characters

Categories : Solr

How can I use Bootstrap Multiselect Dropdown in AngularJS
If you don't need to create code that's very re-usable, it's actually not that complicated. The first step is to create a basic directive and to get the DOM element: angular.module('yourapp', []) .directive('multiselectDropdown', [function() { return function(scope, element, attributes) { element = $(element[0]); // Get the element as a jQuery element // Below setup the dropdown: element.multiselect({ option1: 123, option2: "abcd", // etc. }) // Below maybe some additional setup } }]); Basically, once you are within the directive, it's actually just regular jQuery or JS code. Then in your HTML code: <select multiselectDropdown > <option value="1">One</option> <option v

Categories : Twitter

Dependent dropdown list working in php and not working in codeigniter
try this one put this one var base_url="<?=base_url()?>" somewhere inside the script tag may be before $(document).ready(function(){ line and change the line url: "upload1_site/upload", with url: base_url+"upload1_site/upload", please let me know if it works or not.

Categories : PHP

Populate dropdown using curly braces + angularjs
You certainly can populate a dropdownlist using the curly braces in angular, but it won't have the expected effect. If you want to have the data-binding in your select box, you should use the select directive which writes the option tags in a similar way the ng-repeat directive would. Here's an example: js: $scope.selectables = [ { label: 'A', value: 1}, { label:'B', value: 2}, { label: 'C', value: 3} ]; // this is the model that's used for the data binding in the select directive // the default selected item $scope.selectedItem = $scope.selectables[0]; html: <select ng-model="selectedItem" ng-options="o.label for o in selectables"> </select> <p>Selected item value: {{selectedItem.value}}</p> Here's a demo to clear things up: http://

Categories : Javascript

AngularJS ng-repeat in Bootstrap multiselect dropdown
you may try to take a look at the issue, https://github.com/davidstutz/bootstrap-multiselect/issues/128 and the js fiddle, http://jsfiddle.net/58Bu3/1/ as both are related to use of angular js with bootstrap-multiselect. Here is how I have used it in creating the fiddle. <select class="multiselect" data-placeholder="Select Products" ng-model="productSelection" ng-options="item as item for item in Products" multiple="multiple" multiselect-dropdown > </select> <p>Selection: {{productSelection}}</p> The example is a working one, so go ahead and try it.

Categories : Twitter

Angularjs and filter
It sounds like you are trying to get a list on the code side, not the template. var checked = {}; for(var key in $scope.boxes){ if($scope.boxes[key]) checked[key] = true; // true or $scope.boxes[key], which in your case will be true } // checked will be { "69": true, "72": true, "97": true, "136": true, "396": true} Depending on if you need this value to be constantly updated with each check or not, you may want to put checked in $scope and $watch $scope.boxes, running this for each change. If you only need what is checked before you do something, its best to find what is checked before you do. Just pass $scope.boxes to this: function findChecked(obj){ var checked = {}; for(var key in obj){ if(obj[key]) checked[key] = true; // true or obj[key],

Categories : Javascript

Angularjs ng-repeat race condition in setting dropdown value
So, promises are your friend for this sort of thing. I'm going to use $http instead of resources, because I'm more familiar with it, but I'm pretty sure recent version of resources return promises (or can). Also.. no jquery in your controllers. Use directives like ng-model to change input values. Also using ng-options to populate the options for a select is more powerful than using ng-repeat on an "option" element. Here's what a lot of my code looks like (except that I'm using jsonp here instead of just get). http://jsfiddle.net/HB7LU/142/ CONTROLLER: function MyCtrl($scope, $http) { // The id we want to select when the data loads: var desiredId = 3; // Overly complicated $http request so that I can load with jsonp: // You could normally use just $http.get() $s

Categories : Angularjs

How can I make a
I think you need to make sure selectedContentType needs to be the id field of the option object according to the comprehension expression defined in the select directive. The comprehensive expression is defined as item.id as item.name for item in option.contentTypesPlus item.id will be the actual value stored in the ng-model option.selectedContentType

Categories : Angularjs

Angularjs filter not null
Angular >=1.3.16 to latest (1.4.1 at time of writing/update) use '' (empty string) (or '!!' also works) <ul> <li ng-repeat="detail in details | filter:{shortDescription: ''}"> <p>{{detail.shortDescription}}</p> </li> </ul> Example: http://jsfiddle.net/TheSharpieOne/1mnachk6/ Angular >=1.3.6 and <=1.3.15 use '!null' <ul> <li ng-repeat="detail in details | filter:{shortDescription: '!null'}"> <p>{{detail.shortDescription}}</p> </li> </ul> Example: http://jsfiddle.net/TheSharpieOne/4wxs67yv/ Angular >=1.2 and <=1.3.5 use '' (empty string) (or '!!' also works) <ul> <li ng-repeat="detail in details | filter:{shortDescription: ''}"> <p>{{detail.

Categories : Angularjs

Filter ng-repeat on Angularjs,
<tr ng-repeat="data in dataset | filter:filterFunction"> <td>{{data.id}}</td> <td>{{data.name}}</td> </tr> Controller: $scope.filterFunction = function(data) { return $scope.filterValues.indexOf(data.id) !== -1 ? true : false; }; $scope.filterValues = [12, 14, 23];

Categories : Angularjs

filter service changes from Angularjs 1.0.3 to 1.0.7
Angular seems to be recognizing your href as unsafe. Try something like this in your configuration block: angular.module('module').config(['$compileProvider', function ($compileProvider) { $compileProvider.urlSanitizationWhitelist(/^s*(https?|ftp|mailto|file|tel):/); /* The regular expression will match your "unsafe" link format and add it to the whitelist */ }]); Here's a more detailed explanation: unsafe link in angular

Categories : Angularjs

AngularJS filter on click
Replace the below line <div class="search-result-property" data-ng-repeat="space in spaces| range:sqrf.sqrf:sqrt.sqrt:type.type | orderBy: sqrM"> with <div class="search-result-property" data-ng-repeat="space in spaces| range:filters.sqrf:filters.sqrt:filters.type | orderBy: sqrM"> As you are updating "filters" variable on "submit" button

Categories : Angularjs

How to optimise the $filter in angularjs?
Please use multiple filters, so you don't have to go tweaking everything Take this example as a starting point http://jsfiddle.net/ed9A2/1/ <tr ng-repeat="player in playersFound = (players | filter:{id: player_id, name:player_name, age:player_age})">

Categories : Angularjs

Using Angularjs filter to differentiate between 1 and 10
There is a way to do this. You can write a custom filter: filter('customSearch', function () { return function (input, searchStr) { if (input == searchStr) { return input; } else { return undefined; } }; }); There is jsFiddle using it. Try to enter "1" and after that "10" into the input field.

Categories : Angularjs

Angularjs: $filter in controller
I created a demo for you and hopefully you can compare the code and figure out the issue. I guess you might forget to inject $filter module. Please take a look a the demo. <div ng-app="myApp" ng-controller="ctrl"> <div ng-repeat="image in images">{{image}}</div> <button ng-click="order('0')">By orgName</button> <button ng-click="order('1')">By sortOrder</button> </div> var app = angular.module('myApp', []); function ctrl($scope, $filter) { $scope.images = [{ orgName: 'B', sortOrder: 111 }, { orgName: 'A', sortOrder: 12 }, { orgName: 'D', sortOrder: 13 }, { orgName: 'C', sortOrder: 14 }]; $scope.order = function (order) { if (order

Categories : Angularjs

How to use method as filter in AngularJS?
http://jsfiddle.net/DGKNN/ filter expects there to be an expression that evaluates to a predicate on the scope. That is a function that takes in an element as its parameter and returns whether or not the element should be included in the collection. In your controller: $scope.hasStars = function (message) { return message.hasStars(); }; In your view: <li ng-repeat='message in messages | filter:hasStars | orderBy:"-stars.length"'>...</li>

Categories : Javascript

AngularJS - dependent dropdowns: storing one value in model, using other as source of the next dropdown
To keep things simple you can restructure your model as below where the keys act as ids: $scope.countries = { "c1" : { label : "Country 1", states:{ "s1":{ label:"State 1" }, "s2" : { label:"State 2" } } }, "c2" : { label:"Country 2", states:{ "s3":{ label:"State 3" }, "s4" : { label:"State 4" } } } }; HTML <select ng-model="country" ng-options="countryId as countryDetails.label for (countryId, countryDetails) in countries"> </select> <select name="state" ng-model="state" ng-options="

Categories : Javascript

AngularJs filter on nested ng-repeat
What is the purpose to put the filter on the outer repeater? Just remove it. <div data-ng-repeat="(group, details) in group(reports, grouping)"> Demo

Categories : Angularjs

how to create filter of list
  • using angularJS?
  • I put together a demo of how I would do this, you can view it here. There are a few key differences to your code. The data is stored in an array of nested objects. The filtering is done using an angular filter The tree is rendered using a directive (I got this from someone else's posting a while ago but I can't remember where.. if anyone recognises it let me know and I will credit you)

    Categories : Angularjs

    AngularJS - filter in script src attribute
    I understand that it will be difficult to achieve unless document object has an event that fires before an element is added to DOM and we can manipulate that element's tag in that event handler. For me, the simpler solution was to use a simple REGEX replace at the backend to resolve the pattern with the full URL.

    Categories : Angularjs



    © Copyright 2017 w3hello.com Publishing Limited. All rights reserved.