Questions tagged [linq.js]

An implementation of List and Sequence operations for JavaScript, as inspired by .NET's Language INtegrated Query (LINQ).

LINQ.js

This project is an implementation of List and Sequence operations for JavaScript, as inspired by .NET's Language INtegrated Query (LINQ).

Features

  • All .NET 4.0 methods and many extras (with inspiration from Rx, Achiral, Haskell, Ruby, etc...)
  • Complete lazy evaluation
  • Full IntelliSense support for VisualStudio
  • Two versions - linq.js and jquery.linq.js (jQuery plugin)
  • Support Windows Script Host
  • Binding for Reactive Extensions for JavaScript(RxJS) and IntelliSense Generator -> see documentation
  • NuGet packages: linq.js, linq.js-jQuery, linq.js-Bindings

See or MSDN for more information regarding LINQ itself.

LINQ.js official website: http://linqjs.codeplex.com/

108 questions
1
vote
1 answer

linq.js group by, aggregate multiple fields

I am trying to group my data by 2 properties, and sum two other properties for each group. My code is off just a bit, because I am getting the same sum for both the fields (value and quantity). What am I missing? Thanks! The code - var linq =…
Montoo
  • 31
  • 9
1
vote
2 answers

Multilevel grouping in linq js

I have this json Format var personArray = [ {name:"person1",code:"101011",mainDept:"mainD 1",dept:"dept1",SubDept:"Sub01"}, {name:"person2",code:"201012",mainDept:"mainD 1",dept:"dept1",SubDept:"Sub11"}, …
Haider
  • 615
  • 1
  • 16
  • 38
1
vote
4 answers

Compare two object arrays and combine missing objects

I have 2 object arrays. The 1st is an array of managers. The 2nd is an array of selected managers from the 1st array. The difference is I added a property selected: true. I need to now replace the the managers in the first array with selected…
texas697
  • 5,609
  • 16
  • 65
  • 131
1
vote
3 answers

how to bind data from dynamically named inputs inside a ng-repeat

my goal is to be able to copy data from a table row to another table row. if the data from 2015 has not changed from 2016 the user needs a quick way of copying the values into the 2016 input fields. the models are dynamically created for these…
texas697
  • 5,609
  • 16
  • 65
  • 131
1
vote
2 answers

how to calculate sum of dynamically named model names in a ng-repeat

I have a dynamic table with dynamic inputs. Each input has an unique number added to the end of the model name. There are 10 inputs per table with the last being the total. I need to watch the first 9 inputs and calculate the sum. Here is what the…
texas697
  • 5,609
  • 16
  • 65
  • 131
1
vote
1 answer

SUM and GROUP BY on multiple fields of JSON data using Linq.js

I have a JSON data and I need to do group by and sum the data. Let's say I have a json object which looks like this: var…
1
vote
1 answer

how to compare a string array against a array of objects using linq.js

I need to compare a string array of ids to a array of objects. I need the objects with matching ids to be returned into a object. I need to use linq.js and not sure how to do this. String array that I need to compare against: selectedIds = ["080A8",…
texas697
  • 5,609
  • 16
  • 65
  • 131
1
vote
1 answer

Linq.JS OrderBy with null values

I would like to order my data by the date, but some of the date values are null. How would I go about ordering the data and have the null values be together at the end of my list for descending and the beginning of my list for…
ksumarine
  • 782
  • 2
  • 12
  • 33
1
vote
1 answer

Filtering array where property contains string

I'm trying to filter some JSON data to search for job roles that starts with a certain string. The JSON looks like : "periods": [ { "periodName": "Week1", "teamName": "Tango", "roleName":…
Ben Irving
  • 461
  • 1
  • 6
  • 21
1
vote
1 answer

JSON Linq.js filter on start date end date column

I need to filter results between start date and end date selected by datepicker using reference http://linqjs.codeplex.com/ how can I filter based on my calendar inputs. start date : $('#startdate').val() // MM/DD/YYYY format end date :…
user2118542
1
vote
1 answer

How do I groupby and count json results using linqjs

I would like to return some json from my web method that on the client side I can groupby and count using linqjs. Some mock up data would look like.... var data = [ { Name: "Bob" }, { Name: "Bob" }, { Name: "Ann" }, { Name:…
1
vote
2 answers

Linq.js : Group By two properties (fields)

I have the following array: var source = [ { "DistributorId": 1, "DistributorName": "Distributor 01", "PriceListId": 1, "Year": 2014, "Month": 9 }, { "DistributorId": 1, "DistributorName": "Distributor 01", "PriceListId": 2,…
Taraman
  • 128
  • 2
  • 5
1
vote
1 answer

How to query Json objects using linq.js?

I'm converting a xml file to a Json format, I'm trying to query the Json using linq.js so far this is what I've done: var queryResult = linq.from(result).where( function(x){ return x.key == "bpmn2:definitions" } ).select(function(x) { return x…
pedrommuller
  • 15,741
  • 10
  • 76
  • 126
1
vote
2 answers

Linq.js scoping

I am stuck with the following situation. I have a select statement which uses a function in the current scope me. How do I go about putting me into the select function? var me = this; var results = Enumerable .from(jsonData) …
Tom
  • 15,781
  • 14
  • 69
  • 111
1
vote
2 answers

Linq.js Enumerable.from()

I am new to this very very nice Linq.js library that I have just discovered. I am following the examples to write queries like: Enumerable.from(jsonArray).select(...); // noice Can I do this shortcut? jsonArray.select(...); // error as expected I…
Tom
  • 15,781
  • 14
  • 69
  • 111