I have implemented an onclick event in slickgrid. It works fine if I click on the grid using the mouse but if I trigger a click event from the web console, the value of the row in args is displaying as negative. So I'm not able to proceed further. Any help is appreciated.
grid.onClick.subscribe(function(e, args) {
var row = args.row;
The row is coming as negative if I trigger a click event on the grid using javascript from web console.
I found the solution for the issue. We can trigger the slickgrid events in following ways:- grid.onClick.notify({row:0})
Related
I know that using the template syntax I could use the standard angular 2 (mouseover) event listener to listen for a mouse over event for a specific column. I was wondering if there is a way to listen for mouseover events for an entire row and be able to get the index for that row.
I am trying to a achieve an mouse over hover action the triggers on one row at a time, without having to use multiple <template> tags on each column.
Any help is much appreciated. If there is a better approach then I am all ears.
It is possible to handle the row mouse events from within the 'consuming' component. You should check following GH issue for a runnable sample of such approach: https://github.com/telerik/kendo-angular2/issues/21#issuecomment-247941402
The docs say the scheduler change event is "Fired when the user selects a cell or event in the scheduler."
Great. The problem is that event is also fired on browser window resize. My app now thinks when the browser window is resized that the user clicked in a cell.
How do I distinguish between these two conditions?
Thought I had the answer here but no dice. No idea what causes the scheduler to fire the change event on resizing. I am showing it in a Marionette JS view. Maybe that has something to do with it? Not sure. It shouldn't.
I know it's all wired correctly because the calendar works properly when clicked - correct views are displayed based on whether a calendar slot has an event or is blank. But the change event fires when on window resize causing my app to fire view changes. A break point in the scheduler change event confirms it is firing on window resize.
Below I tried ditching the change event in favor onClick based on some prescriptions found in various posts. Ugly code but it worked in Chrome. Unfortunately doesn't work in other browsers. Why is there simply no "onClick" event? I just looked at a competing scheduler product and it has one.
Chrome only solution: "e" below is the onClick event object:
//Get the element ID - the DOM ID of the thing that was clicked. You'll use it to
//dip into the scheduler data model to get the event specific data you're after.
var uid = e.toElement.parentElement.parentElement.attributes[2].nodeValue;
//Get a reference to the scheduler data model
var scheduler = $("#scheduler").data('kendoScheduler');
//Use the uid to find the event associated with the click action
var event = scheduler.occurrenceByUid(uid);
Here are the posts that helped formulate that Chrome solution:
Call Scheduler events from EventTemplate
Kendo UI scheduler doesn't allow for reliable cell click event handling
Problem with this obviously is that it doesn't work in other browsers. That uid value (e.toElement.parentElement.parentElement.attributes2.nodeValue) is in different places in different browsers. So this solution is a no go.
I have no idea how a product like this doesn't have an onClick event. Likely have to use a different calendar. Very frustrating.
The issue at hand is I am rendering this calendar in a Marionette js item view. when a scheduler cell item is clicked I take the user to a different view. But the event that is used by the scheduler to handle clicks, "change", also fires on browser window resize. So on a browser window resize my app takes the user to a different view. Not good. No work around.
You can reproduce all next steps on standard kendo UI Scheduler example. For example on this: http://docs.telerik.com/kendo-ui/web/scheduler/how-to/dynamic-calc-of-height
Click on empty time slot.
Editor pop up is opening for creating new event
Type title etc.
Click "Save"
Now we see new event on the scheduler table.
But if we do next:
Click on event
Editor pop up is opening for editing event
Click on cancel.
Scheduler - delete the event!
How to save event and prevent this scheduler incomprehensible behavior?
But on this example all works fine.
http://docs.telerik.com/kendo-ui/web/scheduler/how-to/add-control-to-customeditor
Please, explain some one, what is happens? What is the reason of different behavior?
The reason for this behavior is the missing dataSource "schema.model" configuration which is mandatory for the CRUD operations. For more information about how to set up the Scheduler you can check the following help article:
Scheduler: overview
I am using an Ext.grid.plugin.RowExpander which uses Ext.grid.feature.RowBody as the base for toggling. The grid has a double click listener that opens a window. The problem is that double clicking on the RowBody does not fire the double click event on the grid and I cannot even find how to hook the event.
I was dumb and did not read the documentation for Ext.grid.feature.RowBody. It clearly says that the feature exposes three "additional events on the gridview" including rowbodydblclick. There is still some difficulty in knowing which row in the grid or more importantly which record the RowBody that trigger the event was part of.
I am using a datatable to show some information on page and I am binding a click event dynamically to the row of table. It works fine for the first page, but, when I navigate to the second page, the click event is not fired. I can not use .live() or .delegate() as my application is single page application and as per my knowledge these functions attach an event handler for all elements which match the current selector, now and in the future. So, can anybody please give me some suitable solution?
Declare your click event BEFORE dataTable initiation, then it should works.
Hope this help :)