How to use In Filter feature for RelationShipFilter - 2sxc

I have a relationship filter with [In:Filter:Name] option, but Filter have an array with more than 1 result. Filter is working just with first result of array.
RelationshipFilter should work with any of the results for In results array

That isn't supported yet, sorry. You'll have to use LINQ in your template for now.

Related

Meteor dynamic input fields

I'm looking for a way to create dynamic input fields in Meteor.js. I've chosen not to use Aldeed's Autoform for greater control over the code. From front end point of view I have no issues to add dynamic fields with +/- button to add and remove fields. What I'm struggling with is the insert statement on the back end. How can one add dynamic insert in Meteor.js? Cheers!
Essentially you need a reactive array of element that's rendered to the DOM via {{#each}} ... {{/each}}. When the array changes the DOM would re-render.
There's no need to create your own reactive array, there's one here with an example that does exactmy what you're asking for:
http://reactivearray.meteor.com/
However I'd recommend going one step further and using the ViewModel package for this (by the same author). Here's an example which shows how to use it to insert fields:
http://viewmodel.meteor.com/#contacts
Tim
Thanks Tim, these are both pretty useful. I'm using Collection 2 so decided to use objects ('object.$'). This is easy solution for me. cheers.

Find index of item within the array by value?

I am trying to find the index of an item in a classic asp array. i get how it's possible with looping, but is there something else i can use? indexOf() or something along those lines? i can't seem to find anything online
Is it an array of strings, or some other type of objects?
For standard data types you can use Array.BinarySearch(myArray, searchString), but you have to sort the array first.

Is My Query correct?

I am trying to query using objectify to display a list of <Fight> with eventEid = 111. Is the below call correct? I ran it and it returns 0... but its strange because it looks right
Please note that eventEid is a long. Does that affect the query?
ofy().load().type(Fight.class).filter("eventEid", 111).list();
Make sure that eventEid is indexed property.
Filtering on unindexed properties returns no results.
https://developers.google.com/appengine/docs/java/datastore/queries#Filters

How do you get a Min() or Max() in drupal using views?

I'm using Drupal's Views 2, and need to retrieve min values from fields in a custom table. The query for this is easy if I were writing it by hand--something like, "SELECT foo, min(bar) FROM table GROUP BY foo." But how would I do this using Views? I've already defined the table in a views.info file, so there's no trouble getting views to see the table. It's the Min() part of the query I just don't understand. My next stop will be the Views API documentation, but if someone can just provide the outline for how to do this quickly, I would greatly appreciate it.
New answer to an old question, but something like this will work. You need to create a custom field handler and then wrap the field as follows:
class views_handler_custom_field extends views_handler_field {
function query() {
$this->ensure_my_table();
$this->field_alias = $this->query->add_field("MAX({$this->table_alias}", "{$this->real_field})",$this->table_alias . "_" . $this->real_field);
}
}
Use aggregation from advanced configuration of views. After this is set
yes you can select max, min or any other selector to fields.
Test your results but it should work well
Alternatively in some cases you can sort your data ascending or
descending and then just pick one to be shown on the view. Can be
problematic when displaying multiple fields or so.
After testing first one seems to be faster at least on small scale.
One could consider the modules groupby and views_calc, but I assume they are not acceptable for you.
Additionally, you can accomplish this with a custom module.

Good way to rename fields in Actionscript array?

Should be easy but google couldn't give me a straight answer. I have an array. The fields in the array have underscores that I would like to remove e.g. "Column_1" to "Column 1". Does anyone know a good way to do this without looping through the whole array and rebuilding it anew? I didn't see any methods in the reference that would make this easy. thx
Depending on where you are using this Array, you could use the labelFunction to format the data before presenting it. It is present in Lists, DataGrids and Trees.
But you'd only need this if you have a very large data and wouldn't want to loop over all the records before showing them. A labelFunction would "reprocess" the label everytime before it's presented.
Flex 3 has built in refactoring
Edit... I may have misunderstood..
If you want to format the data in the array just loop through it and use regex to remove the underscores... or you can modify your query which grabs the data (if it is populated from a query)

Resources