I wanted my ag-grid to be scrolled back to its original position after refresh which is not happening so I researched and found this ensureColumnVisible in grid api. Please help me finding the solution to it.
Event handler to be used for this ensureColumnVisible
This page shows all of their available events. I guess I would suggest the RowDataUpdatedEvent, based off your brief description?
The client has updated data for the grid by either a) setting new Row Data or b) Applying a Row Transaction.
Providing more detail always helps in providing a better answer; any details of things you've already tried, existing code snippets, etc. would help pinpoint more precisely what you want.
Related
I'm not sure if the name "scroll bar" is true at all. I would like to install a scrollbar, in which you can simply select a city with the mouse wheel (on a smartphone with a wipe) and then select the possible cities of the respective country in the second window.
I mean something like this has already been seen but unfortunately I could not find a good example.
Does anyone know the exact name and has perhaps a sample code?
Updated the answer as per comment
I think you better use Select2 for this.
You can find all the details and support you need in its Basic Usage page.
And about your Question - only post question if you have tried solving it by your self (if you have tried, post the method you have tried with a sample code) or try Googling it, this may help more than you know.
Update2
As per your comment, i understand that what you need is a spinner in this case you can use Input Spinner Plugin for this. You will need some styling changes but this will work your way.
Hope this was helpful for you.
So, I am using Twitter Bootstrap, I have a table which has a new row appended every time. However intermittently when I append a new tr, borders on the side of the page don't update correctly. See the three border lines on the left. Is this a height issue?
Browser: Chrome Version 32.0.1700.77
Ok, just for some closure here.
The method I was using of appending items to the DOM is unwieldy especially in the backbone setting I was working in. I can't tell you why exactly this was happening other than it was outside of my control.
The correct thing to do here was to rerender the view once the data had changed.
I know this answer doesn't directly address the question but it was indeed the answer to my problem.
I previously asked this question a few days ago, but I do not think anyone besides paxRoman actually figured out what I was asking, as it was hard to describe without an example.
We did however manage to figure out what might be my problem, and I managed to put the code up on bl.ocks.org so you can see an example of what I mean!
Here is the example: http://bl.ocks.org/3020018
Each time the data is refreshed (in this example, just read from a json file), all the nodes are re-created and re-added to the drawing.
What I want to happen
I want the nodes to update without moving at all.
If a new node exists in the new array, it should just appear like they all do now, if something exists in the previous array but not in the new, it should simply disappear.
As you see in the example, that is not what is happening and I have not been able to figure out why for the past week.
So my question is:
What am I actually doing wrong? Is it my lack of links? What is the problem? The two of us spent over an hour looking at this yesterday and could not make sense of it, I have spent a good week on it now without much progress :/
My old question/post is still up, but it's badly formulated and I had no example to show.
Thanks for helping me :)
So, I am pretty sure I have solved most of my problems!
It came down to how I was adding/modifying the nodes when updating the data. I completely forgot about x/y and similar attributes since I did not set them myself, so I was adding "new" objects every time I updated the data, even if they weren't actually new.
With some jQuery magic using $.extend() I have sort of gotten it working, but it's still slightly moving/pulsing whenever I update the data.
I updated the gist to show the changes. http://bl.ocks.org/3020018
I would still like to remove that little pulsation too, so let me know if you have any ideas :)
Have you tried setting the friction parameter (where you have the linkDistance and charge set)? Setting it to 0.9 will speed up finding the final position as I think it defaults to 1 if not set. Its simply a case of adding
.friction(0.9) // or any suitable value closer to 0 - have a play!
Hope that helps
Is it possible to make the first column of a SlickGrid fixed? So that it is always visible during horizontal scrolling, like the header-row?
Thanks for help!
There was another forum link (can't find it now) that lead my to JLynch's fork. He maintains both a 1.4.3 tag with his patches for frozen columns and rows, as well as maintaining a 2.0 head. Here is the 2.0 example with both frozen rows and columns.
In that example, the author uses a couple additional options properties:
,topPanelHeight: 25
,frozenColumn: 2
,frozenRow: 5
Hopefully this does what you want without having to hack too much on the core!
I think you can make in the event .onViewportChanged() the next steps:
Get the columns with .getColumns() and stored in an array variable arrColumns.
Then detect the first column.
Store the data with .getData() in an array variable arrData
Sort arrColumns putting the first column at the beginning.
Set the columns in the new arrColumns with .setColumns()
Reassembly arrData with the order of the new arrColumns.
Call .resizeCanvas()
Cross your fingers. :D
Sorry but I don't find a method or an option in that you can make this behavior in the way that you want.
Well, see what you think of this. It is far from perfect, but it is an idea. I would make something better if the method scrollTo() would be public.
I know this doesn't fully match your needs, but you can completely avoid horizontal scrolling by setting forceFitColumns to true in the options object.
I reckon that this behavior would be undesirable for users with a very small screen.
I have a game that requires you to click on an object to collect prizes, but instead of giving my user carpel tunnel I want to create an autoroller. I have some code done already but I can't get it to work. If there is anyone out there that would be able to help me get this code working, it would be greatly appreciated.
Since you didn't give a very specific description of your problem, I'll give you a somewhat vague answer. However, you may find it helpful:
When the user clicks on the object to collect prizes, bind the window.scrollTo() method to the document's mousemove event.
Each time the mousemove event is fired, it can kick off the scrollTo event.
Look for changes in the y parameter, and scroll + or -
I don't actually recommend creating this behavior, though (in terms of usability). You may want to think of a better way to layout the prize selection so it is more intuitive to the user.
MooTools has an autoscroller, as does jQuery.