search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Ability to add/remove/update rows without updating entire control

Asked by Gaz Black
8 years ago.

Hi,

As it stands, the only way to add/remove/update a row within the scheduler is to update the resources array and fire the update method against the control. This is fine for small datasets, however for large (500 rows, 700 events), this is a big performance hit (especially if you need to update certain rows frequently). When a full update kicks in, we're looking at a 4 second hit on lower spec machines on IE11.

It would be a huge benefit if the scheduler had the ability to update a batch of rows rather than everything at once. I suppose the same would apply to events too as you can only update one at a time or everything at once.

Any feedback would greatly be appreciated.

Note: this is mainly noticeable within IE8+...no surprises there!

Comment posted by Dan Letecky [DayPilot]
8 years ago.

Gaz,

What properties of the row do you need to update?

  • grid cells
  • row header
  • events

There is an API for modifying individual grid cells, row header cells, and events. Adding or removing a row will still require a full update, however.

However, the update is designed to be a relatively fast and cheap operation (with the Scheduler progressive rendering properly configured). 500 rows and 700 events shouldn't need 4 seconds to redraw.

There is a performance-focused reference implementation of Scheduler in the works - I will make it available online so you can check it and compare with your app.

Also, make sure that you are using build 8.1.1969 or later - it includes many performance optimizations (especially for longer timelines).

http://javascript.daypilot.org/daypilot-pro-for-javascript-8-1-sp8/

Comment posted by Gaz Black
8 years ago.

Many thanks for the quick reply Dan.

Our version is 8.1.2007.

We would need to update the resource cell's text and style. If there's an API for this, could you please guide me on how to call this?

We have disabled the progressive rendering, therefore we display all elements within the DOM. This is due to the time it took to render the resources when jumping to a resource e.g. 200 rows below. The on the fly rendering also has a CPU hit therefore we found it much better to use with a longer initial load time.

Some of our customers have poor spec machines running IE therefore we're testing this control at worse case scenario. We've already set the minimum version to 10 but due to potential high volume of updates, the performance is holding us back.

We would be more than keen to try the performance enhanced version.

Answer posted by Dan Letecky [DayPilot]
8 years ago.

You can find and modify the cells using cells.find(), cells.findXy() and cells.findByPixels() methods:

http://api.daypilot.org/daypilot-scheduler-cells-find/
http://api.daypilot.org/daypilot-scheduler-cells-findxy/
http://api.daypilot.org/daypilot-scheduler-cells-findbypixels/

Example:
dp.cells.find("2016-10-01", "A").html("10/1/2016");

You can also control all cells in a row:
http://api.daypilot.org/daypilot-row-cells-all/

dp.rows.find("A").cells.all().html("A");

The row headers can be accessed using rows.find():
http://api.daypilot.org/daypilot-scheduler-rows-find/

var row = dp.rows.find("A");

and modified using addClass(), removeClass(), column(i).html():
http://api.daypilot.org/daypilot-row-addclass/
http://api.daypilot.org/daypilot-row-removeclass/
http://api.daypilot.org/daypilot-row-column/

dp.rows.find("A").addClass("resource-a");

> We have disabled the progressive rendering,

Unfortunately all performance tweaks work with progressive rendering because that's the only scalable solution. The progressive rendering improves scalability at the expense of delays during scrolling. You can tweak the delays (see http://doc.daypilot.org/scheduler/scrolling-performance/) but it it can't be completely eliminated.

You can also check your implementation of real-time rendering events (like onBeforeEventRender, onBeforeCellRender). Older IE version are particularly sensitive to inefficiencies there - try to make them as fast as possible. You can check if this is the problem by turning them off temporarily.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.