What are the differences between Select2 and selectize? - jquery-plugins

What are the differences between Select2 and selectize? I was using select2 from a long time, but recently known 1 more plugin called selectize. I want to know which 1 is better than other.

Related

Combining two xpaths into one xpath

Is it possible to combine these two Xpaths into one xpath query?
signatureAgreementThumbnailForInProgressApplication = By.XPath("//div[text()='Upload Signature Agreement']/parent::div/parent::div/descendant::div[contains(#style,'background-image: url')]");
signatureAgreementThumbnailForSubmittedApplication = By.XPath("//div[text()='Signature Agreement']/parent::div/descendant::div[contains(#style,'background-image: url')]");
My automation test (project is VS/C#/Selenium) requires validating the presence (but not content or anything else) of document thumbnails for two statuses of an online application: in-progress and submitted. I feel two separate methods with different xpaths is redundant, since I am doing the same simple validation.
After looking through SO posts which suggested using and/or to evalute multiple attributes, I created this below query which works almost perfectly for both In-Progress and Submitted thumbnails. Minor issue is that for Submitted, in DOM, the xpath hits two thumbnail elements, the one I want it to hit and another one. My test still passes since it is validating thumbnail presence, but I am hoping to tweak it so it finds the specific thumbnail.
signatureAgreementThumbnail = By.XPath("//div[text()='Upload Signature Agreement' or text()='Signature Agreement']/parent::div/parent::div/descendant::div[contains(#style,'background-image: url')]");
I also tried the following queries, which do not work at all:
//div[text()='Upload Signature Agreement' or text()='Signature Agreement'][/parent::div/parent::div/descendant::div or /parent::div/descendant::div][contains(#style,'background-image: url')]
//div[text()='Upload Signature Agreement' or text()='Signature Agreement'][/parent::div/parent::div/descendant::div or /parent::div/descendant::div and contains(#style,'background-image: url')]
I cannot provide the URL of the site I am automating since it is a private site.

Apply a sort to a dataset in a PowerApps component (PCF)

I’m trying to create a new dataset type Powerapps Component (PCF). For the moment I am using it to display a view of the records that are available in an entity in Microsoft Dynamics CRM.
I wish to make the view sort itself when I click on the grid column headers (in a similar way that the default CRM grid view does). I'm trying to figure out how to apply a sort to the dataset so that I can refresh it as indicated by the documentation for the dataset.refresh() function:
Refreshes the dataset based on filters, sorting, linking, new column.
New data will be pushed to control in another 'updateView' cycle.
The dataset object does have a “sorting” property, but changing its value and then refreshing the dataset doesn’t seem to have any effect. After the refresh, the sorting property reverts to the value it had before I changed it.
In short, the click handler for the grid header does something like the following bit of code. The refresh gets done and my updateView() function gets called as expected but the sorting was not applied.
dataset.sorting = [{name: 'createdon', sortDirection: 1}];
dataset.refresh();
Any help on getting the dataset sorting to work would be appreciated.
I've been experimenting with PowerApps Component Framework a little bit recently and I can confirm that the following code won't be working:
dataSet.sorting = [ { name: "columnName", sortDirection: 0 } ];
However, I managed to get this one working for me:
dataSet.sorting.pop(); // you may want to clean up the whole collection
dataSet.sorting.push({ name: "columnName", sortDirection: 0 });
I haven't really figured out the reason of this behavior. The sorting array may be implemented as some form of observable collection in the background.
I hope this will guide you to a functioning solution.
The documentation is pretty abysmal here, but here is my best guess from putting a few different pieces of information together.
TLDR: I think there is some kind of extra method that needs to be called on the .sorting property, but I can't find out what it is called. Maybe something like:
dataset.sorting.setSorting({name: 'createdon', sortDirection: 1});
I think you're going to have to try a bunch of likely method names and see what works.
Background and links:
The only reference I could find to dataset.sorting was from here:
In this preview for canvas apps, only a limited set of filtering and sortStatus methods are supported. Filter and sort can be applied to dataset on primary type columns except for the GUID. Filter and sorting can be applied in the same way as in model-driven apps.To retrieve the dataset with filtering and sorting information, call
the methods in context.parameters.[dataset_property_name].filtering
and context.parameters.[dataset_property_name].sorting, then invoke
the context.parameters.[dataset_property_name].refresh().
So it seems that the .filtering and .sorting properties are handled similarly, and that there are some methods attached to them, and only some are supported. That is about as vague as they could make it...
I did find an example of how .filtering is used:
_context.parameters.sampleDataset.filtering.setFilter({
conditions: conditionArray,
filterOperator: 1, // Or
});
There is a brief reference to .setFilter() in the docs, as well as FilterExpression
There is a SortStatus reference, but it doesn't have any corresponding methods explicitly called out. It is possible that this is not yet a supported feature in the public preview, or the documentation is lacking and the name and syntax of the method you need to call on .sorting is not yet documented.

Which is the best way to implement datatable in angular 6

I need to implement Datatable in Angular 6 project. I need to know which is the best way to implement it with full features. As it is confusing as we have multiple options.
I have came across multiple npms. In which i will select this 3 npms as my last options.
1. angular-datatables, 2. angular-6-datatable, 3. datatables.
angular-datatables :- Well documented and many code samples is available, seems like i should go with this. But it is dependent to jquery and would it affect my angular project that is my major concern for this npm.
angular-6-datatable :- Not dependent on jquery, code samples are avialable but not that much.
datatables :- Looks like same as angular-datatables npm
Some one please suggest me the best way to go and why should i select that.
Thanks & Regards
use angular material table it will support all operations like sorting, filter, lazy loading etc..
for more info read
refer live example

Wicket DropDownChoice Integer

I have problem with Wicket DropDownChoice. The DropDownChoice does not show values for Integer.
wicket version: 1.5.7
DropDownChoice<Integer> rEvalFormVersion = new DropDownChoice<Integer>("evalForm.version", EVAL_FORM_VERSIONS);
where EVAL_FORM_VERSIONS is list of versions.
For example: In the list are two versions, DropDownChoice is populated by two choices but nothing is shown.
Btw: Another data types work good.
In the near future we will update Wicket to a new version. Is this problem in Wicket 6 or can I simply just wait for new version?
Looking at the wicket examples (and from experience) this should simply work. In the example they do define an IChoiceRenderer for the DropDownChoice.

Forcing JQuery Datatable to load data via AJAX upon selection of a date range

I have the wonderful jquery data tables currently loading data using ajax.
The code is pretty much the same as the example I took it from which can be found at: http://www.datatables.net/release-datatables/examples/server_side/pipeline.html
I found this the best example because it incoporates pagination, sorting and also the search box into the ajax requests. The search box allows you to type in key words and this triggers the ajax function which includes the search value as a $_GET var to the server script.
This is a small preview of my table with table tools etc. loaded.
http://img828.imageshack.us/img828/9778/previewxjh.png
As you can see the main focus here is the filament groups date range plugin which I have added. I have finished with this now, and have a fail safe for the duplicate event firing problem etc. its ready to go and just needs including in the ajax pipeline - which is where I have been stuck for the last day or so.
fnDataTablesPipeline appears to be just an interim and doesnt reference the search box at all, so I can't figure out how the search box is working, and I am unsure if this is the right place to go including my date range value (everything I have tried just leads me to a dead end)
I want to use my onChange event for the date range filter, and apply it exactly the same way that the search box works. When the value is changed, simply pass it as a get variable so that my php script can deal with it there. I have concerns regarding the paging, and I will probably need to just reset back to page one after the date is changed (not sure how I am going to deal with this just yet, but thats the next step)
I need help telling datatables to refresh from the ajax source, and include the date range as a get parameter to the server side script (like when the search box value changes)
- sounds straight forward, but this is where I am breaking down and not making good use of my time due to the lack of understanding.
Is there anyone that has implemented similar that can help me?
The biggest problem right now is how to force the refresh from my date range onChange event, and of course include the single string value which contains my dates (which I know how to cover server side)
Many Thanks,
Chris
EDIT: I actually managed to get this working before I finished for the day. I'll post my code when I get back in the office tomorrow, it was actually surprisingly easy - I was tackling it completely wrong.
After changing date..
oTable.fnClearTable(0);
oTable.fnDraw();
Include var in pipeline
function fnDataTablesPipeline ( sSource, aoData, fnCallback, dateRange ) {
aoData.push( { "name": "dateRange", "value": $('#dateRangePicker').val(), } );
...
Obtain var in php script
$_GET['dateRange']

Resources