I'm implementing a listMonth in fullCalendar. I want to invert the order, and show first on top of the recent events, not in the bottom. How can i do it?
To go from: to:
The only way to do this in the latest version (3.4.0) is to alter the source code.
Specifically, on line 6297 of the unminified source is the function
compareEventSegs: function(seg1, seg2) {...
To reverse the event sort order just swap the order of the seg1 and seg2 parameters around:
compareEventSegs: function(seg2, seg1) {...
Similarly, for the minified source, search for compareEventSegs:function(t,e) and do the same.
Note that this will affect ALL views.
Finally, if you want to implement more complex logic for the event sort order, this is the function to adjust.
Related
Tokenize2 is a javacsript lib to select multiple options.
It provides a very neat UI to start writing and then get a list of options to select from. Selected options will show up as "tags" that can be removed with "x" link.
So far all is fine. But Right now you need to know what your looking for and start write at least one character to see matching alternatives.
In my scenario there are very few alternatives and they are not known to the user. I would like to show ALL options when the user clicks the input box. There is a configuration option named searchMinLength but it is already set to 0.
Is there a workaround that can be used? Maybe like triggering load and dropdown manually?
I know there are a lot of similar alternatives but I picked Tokenize2 because:
It looks clean and nice
It works in mobile browsers
I don't know if there is an "official" approach, but after some investigation I have found an acceptable workaround.
After downloading the Tokenizer2 sourceode I found the following line that triggered my attention:
if(this.input.val().length > 0){
this.trigger('tokenize:search', [this.input.val()]);
}
My interpretation is that the internal search command is not triggered unless the user input has at least one character. This line in sourcecode could easily be modified. I have filed a suggestion for this here: https://github.com/zellerda/Tokenize2/issues/26
My current workaround is to add an event listener for the select event and there trigger the internal search command. That works fine for my scenario and does not force a source code rewrite.
$("#my-dropdown").on("tokenize:select", function (e: Event, routedEvent: boolean) {
$("#my-dropdown").trigger('tokenize:search', "");
});
Tokenize2
This link worked for me GitHub
$('.tokenize-sample-demo1').on('tokenize:select', function(container){
$(this).tokenize2().trigger('tokenize:search', [$(this).tokenize2().input.val()]);
});
Edit: Found out move column doesn't work in v6.4.0
Example Link:
https://www.ag-grid.com/javascript-grid-tool-panel/toolPanelExample.html
The order of columns visible in the tool panel are always in the same order that they are defined in the column definition. Check the image below.
Is it possible to sort them in the tool panel in an order(say alphabetically) but without changing the order they are shown in the grid.
What I tried:
I tried defining them in alphabetical order in the columnDefination and tried to move them to there position using the columnApi.moveColumn(). That doesn't seems to work either also that increases the complexity when I have to move all the columns and position them.
Questions:
Is this even possible/feasible?
The moveColumn() function is not working. Can you tell in which version it was introduced not able to find it in changeLog.
Additional Details:
Using ag-grid enterprise version v6.4.0
Please refer to this plnkr. I used the same basic idea that you had, creating the colDefs in alphabetical order then in the onGridReady function moved the columns to their respective placements. There are two functions that are useful in doing this, the second is much preferable in my opinion:
moveColumn(colKey, toIndex)
//colKey refers to the id of the column which defaults to the specified field
//toIndex is simply a number that is within the range of columns.
moveColumns(colKeys[], toIndex)
//colKeys[] is an array in the order that you want them to be
displayed starting at the toIndex
Here is how I implemented it in the plnkr:
private onReady() {
// this.gridOptions.columnApi.moveColumn('name',1)
// this.gridOptions.columnApi.moveColumn('country',2)
// this.gridOptions.columnApi.moveColumn('dob',3)
// this.gridOptions.columnApi.moveColumn('skills',4)
// this.gridOptions.columnApi.moveColumn('proficiency',5)
// this.gridOptions.columnApi.moveColumn('mobile',6)
// this.gridOptions.columnApi.moveColumn('landline',7)
// this.gridOptions.columnApi.moveColumn('address',8),
this.gridOptions.columnApi.moveColumns(['name', 'country', 'dob', 'skills', 'proficiency', 'mobile', 'landline', 'address'],1)
}
There is one more function that is available to you if you would like to use it:
moveColumnByIndex(fromIndex, toIndex)
//This uses just indexes and not the colid/colkey idea if you prefer
to keep it more anonymous
I am having problems in Capybara with the Ambiguous match problem. And the page provides no 'ids" to identify which one is which.
I am using within function.
within('.tile.tile-animation.animation-left.animation-visible.animated') do
#some code in here
end
I've used the :match option which solved my first problem.
within('.tile.tile-animation.animation-left.animation-visible.animated', :match => :first) do
#some code in here
end
The question is how to get to the SECOND css '.tile.tile-animation.animation-left.animation-visible.animated' ?
It depends on the html -- a simple solutions is
within(all('.tile.tile-animated.animation-left.animation-visible.animated')[1]) do
# some code in here
end
which will scope to the second matching element on the page, but won't be able to auto-reload if the page changes, and won't wait for the elements to appear. If you need it to wait for at least two elements to appear you can do
within(all('.tile.tile-animated.animation-left.animation-visible.animated', minimum: 2)[1]) do
....
which will wait some time for at least the 2 elements to appear on the page, but still won't be able to auto-reload if the page changes. If you need the ability to auto-reload on a dynamically changing page it will need to be possible to write a unique selector for the element (rather than indexing into the results of #all.
I have a need to filter the list of available assets from which to choose to those assets that reside at the location of the current work order. I do not want to see assets in the list that are not at the current location.
I have located a place in the javascript
var filter = [];
filter.push({siteid: siteid});
additionalasset.lookupFilter = filter;
... which appears to let me push filters into a filter array. Would this be the ideal method to use? 1) Determine the location on the work order and 2) push an additional filter e.g.
filter.push({location: location});
I'm looking for a solution that is dynamic, such that if the user changes the location and then wants to select an asset, the available list of assets will update, based on this filter, to those assets at that location. I hope this is understandable.
This bit of code did what I needed. For some reason I can push multiple filter critera on one call to .push() but I can't .push() multiple filters separately as I was trying before.
var currLocation = workOrderSet.getCurrentRecord().get("location");
filter.push({siteid: siteid, location: currLocation});
Yes this is exactly how you should do this code wise. We had a bug (fixed in 7.5.2.1 I believe) where the very first location you picked would be reused the second time you tried to select the asset. If you're still seeing the same behavior at 7.5.2.1, open a PMR and we can get you an iFix to support this.
In the icCube Web Reporting you can set a graph and chart to respond on a click row/column/cell event and inidcate what must be done when the widget receives a click.
In this particular case I have the rows ordered based on a parameter.
But when I click on the row in the graph, the children are displayed without any order.
I found the following workaround, but it helps only with a named measure not a parameter:
use navigation strategy MDX iso children and use:
ORDER ($member.children, [measures].[amount], BASC)
the following gives an MDX error:
ORDER ($member.children, #{PARAMETER}, BASC)
The cause for the error is that it does not replace the #{PARAMETER} with the actual value.
Is there any other way/workaround to get this working in icCube?
A live working example explaining the questiuon can be found here
Sorry, it's a limitation - bug - in the current version : http://issues.iccube.com/issue/ic3pub-165
Will be fixed in 5.1.2