fnServerParams isn't working for me - datatables

I need to send custom filters to my server side processing for dataTables.net
I have a drop down which contains dates, after the user has seleted a date, then the tables need to reflect the option they have selected. I can't for the life of me work out why this isn't sending anything:
"fnServerParams": function (aoData) {
aoData.push({"name": "iArchiveYears", "value": $("ddYears option:selected").text()})
when I look in firebug, iArchiveYears in there, but empty.
Even hardcoding a value in here instead of the drop down value doesn't work.
Any advice most welcome.

Use $("#ddYears option:selected")
Instead of
$("ddYears option:selected").
# missing.

Related

#Dblookup and formatting on web

I have been developing a web application using domino, therein I have dblookup-ing the field from notes client; Now, this is working fine but the format of value is missing while using on web.
For example in lotus notes client the field value format is as above
I am one, I am two, I am one , I am two, labbblallalalalalalalalalalalalalalalalalalaallllal
Labbbaalalalallalalalalalaalallaal
Hello there, labblalalallalalalllaalalalalalalalalalalalalalalalalalalalalalalala
Now when I retrieve the value of the field on web it seems it takes 2 immediate after 1. and so forth, I was expecting line feed here which is not happening.
The field above is multi valued field. Also on web I have used computed text which does db lookup from notes client.
Please help me what else could/alternate solution for this case.
Thanks
HD
Your multi-valued field has display options associated with it and the Notes client honors those. Obviously, your options are set up to display entries separated by newlines.
The computed text that you are using for the web does not have options like that and the field options are irrelevant because you aren't displaying the field. Your code has to insert the #Newlines. That's pretty easy because #DbLookup returns a list, and if you concatenate a list and a scalar, the scalar will be appended to each element of the list. (Look at the third example under "concatenation, pairwise" here to see what I mean.
The way you've worded your question is a little unclear to me, but what you need in your computed text formula is either something like this:
list := #DbLookup(etc,. etc.);
list + #Newline;
Or something like this:
multiValueFieldContainingListWithDbLookupResult + #NewLine;
I used #implode(Dblookupreturnedvalue;"");
thanks All :)

yadcf externally triggered filters 'shut off' the actual filtering

I am trying to set my yadcf filters up so they can be triggered from a call (link) from another page. I have an angular single page application that has three tabs on it. If a user clicks a link on lets say the first tab, they will go to another tab (separate table) that contains detailed information relevant to the link they click. (e.g. They are on a row in a table that deals with Apple Mac Pro computers. They see that there are 20 skus currently in the system. They click the number 20 and they go to a lower tab (different table) that contains all the information for those skus). There is no server call in the middle. All the data is loaded in all the tables when the application loads up. So, they are simply clicking a link that applies a filter to the detail table.
yadcf can do this through externally_triggered filters. However, when I set 'externally_triggered': true, it stops the actual filters from working on the details table. (In other words, I can no longer go to that table and manually adjust the filters.)
Does anyone know a way around this issue?
It appears the externally_triggered: true switch does not need to be turned on to use yadcf.exFilterColumn() method. I do not understand when it does need to be turned on, but I am able to call the exFilterColumn method and pass it the options needed to 'prefilter' the table while still retaining the ability to filter the table manually.
externally_triggered and yadcf.exFilterColumn are not related in any way, indeed when yadcf.exFilterColumn is used filters behave a bit differently - they are not filtering on change/keyup/etc , but rather only when the uadcf.exFilterExternallyTriggered function is called (its on purpose and all is explained in the docs)
Here is the relevant text from the docs of the externally_triggered, here it is:
* externally_triggered
Required: false
Type: boolean
Default value: false
Description: Filters will filter only when yadcf.exFilterExternallyTriggered(table_arg) is called
Special notes: Useful when you want to build some form with filters and you want to trigger the filter when that form
"submit" button is clicked (instead of filtering per filter input change)
Here is the showcase page

yadcf interface change to exFilterColumn confusion

I am upgrading the yadcf version on my site from 0.6.9 to 0.8.8. (I'm also upgrading from datatables 1.9.4 to 1.10.10)
See the 0.6.9 version at my production site and the 0.8.8 version at my sandbox site
I have updated my calls to yadcf.exFilterColumn from two calls to a single call because now the defaults take an array of pairs.
But my filtered dataset is empty when the page loads, and I need to select a gender then click all for all the data to show up.
I'm sure it's something I'm not quite getting for the new interface.
Update: Simplified sandbox version here. See file TestStandings.js
Update 2: Daniel pointed out that "-1" for gender filter won't work. Apparently usegender = "-1" doesn't behave the same way in 0.8.8 as it did in 0.6.9 for some reason. I could try to figure out why it used to work, but that seems unproductive.
I added the following code after the exFilterColumn call (it's necessary for the gender to be filtered in some use cases)
// reset gender column if didn't mean to filter
if (usegender == "-1") {
yadcf.exResetFilters( _rrwebapp_table, [genderCol] )
}
but this gets exception at line 3624 of jquery.dataTable.yadcf.js because settingsDt.aanFeatures.f is undefined
Update 3: while debugging on the datatables side, I changed sDom from '<"H"Clpr>t' to the default 'lfrtip'. The exception mentioned above went away and the table loaded properly.
Here is how you should handle your scenario
Its wrong to ask for filtering for a -1 value because there is no such value in the table, so in order to reset a specific column just before calling exFilterColumn you should use the exResetFilters with noRedraw set to true (grab from 0.8.9.beta.31) you should call this function before your exFilterColumn
Old answer
I might have noticed multiple calls to the exFilterColumn for the same table, while in fact you should call it only once, just set the desired values for each column of the table,
See showcase page (first table)
And notice the relevant code below
yadcf.exFilterColumn(firstTable, [
[1, {
from: 1,
to: 40
}],
[3, "a_value"]
]);
If it still no goodm please provide the your table / yadcf init code and the code for calling the exFilterColumn
Update:
I noticed that your are using the following line of code
yadcf.exFilterColumn(_rrwebapp_table, [[divisionCol, usedivision], [genderCol, usegender]])
Where your usegender is set to "-1" which makes no sense, because its the value of the Select input reset option, so make sure you dont use "-1" as values in your exFilterColumn calls...

Filter lookup inside a Dialog- CRM 2015 Online

How can we filter a lookup that is in a page of the dialog process.
E.g. I have a lookup to "incident" on Prompt and Response, I would like to filter it based on the value of a field in incident entity.
I tried:
Creating new views, also setting it as default.
addPreSearch and addCustomFilter on the field on the form(Not sure how to use these scripts inside the Dialog)
Any Ideas ?
Thanks you
Unfortunately this is not possible.
As an alternative you could consider adding a query to the dialog and a page with a prompt having an Option Set (picklist) response type.

Validate number of attributes with date_select

I'm doing something like the following: Validate number of nested attributes.
I'm checking for existence of at least one nested attribute.
This was working fine when I was using a text input for the date but I've changed it to use a date_select instead and now the same validation code shows an error saying that not enough have been chosen.
When it fails validation and reloads the form it also doesn't "build" an instance of the nested attribute either so it just shows my "[+]" link
Anybody got any ideas?
Failing everything I'll just have to put the text field back (probably using type=date).
Col
I decided to just put the text field back.