This is a migrated thread and some comments may be shown as answers.

use web socket as data source on gantt

4 Answers 142 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Vedad
Top achievements
Rank 3
Bronze
Bronze
Iron
Vedad asked on 03 Jul 2019, 12:49 PM

Hi, 

sorry if I am posting question that is maybe answered somewhere else, but I searched and didn't find anything.

I know it is possible to use WebSocket as dataSource on grid as shown on one of your examples, but wanted to check if it's possible to use web socket as DS on gantt and if yes, will it behave the same way as grid in terms of updates etc.

 

Thank you

4 Answers, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 05 Jul 2019, 04:13 AM
Hi Vedad,

The WebSocket binding demo available for the Grid shows a full DataSource customization. https://demos.telerik.com/kendo-ui/grid/web-socket

As the transport methods are defined as functions every aspect of the DataSource is under the control of the logic implemented. That means that every widget (plus the Gantt) will work as required with the customized DataSource implemented. Shortly, following the same techniques should work for the Gantt to. 

Regards,
Ianko
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Vedad
Top achievements
Rank 3
Bronze
Bronze
Iron
answered on 08 Jul 2019, 08:07 AM

Hi Ianko, 

Thank you very much for a prompt response. I will try it.

Regards,

Vedad

0
Vedad
Top achievements
Rank 3
Bronze
Bronze
Iron
answered on 29 Jul 2019, 01:38 PM

Hi Ianko, 

I managed to connect gantt to the webSocket, but I run onto strange behavior which is kind of confusing.

For testing purposes I set webSocket to return exactly the same response as service originally used, but for some reason, function originalFunction used in wrapDataAccess, exactly the same input treats differently.

With original service call, on bolded line below, response object which contains array of gantt elements is transformed into array and parsed properly, but when webSocket returns exactly the same response (I even copied that response and even hard-coded webSocket to return it), it creates a new array and places my object as one of the properties within.

        function wrapDataAccess(originalFunction, model, converter, getters, originalFieldNames, fieldNames) {
            return function (data) {
                data = originalFunction(data);
                return wrapDataAccessBase(model, converter, getters, originalFieldNames, fieldNames)(data);
            };
        }

Any idea/suggestions why? :)

 

Thanks and regards,

Vedad

0
Vedad
Top achievements
Rank 3
Bronze
Bronze
Iron
answered on 29 Jul 2019, 02:58 PM

I figured out why, because there is custom transport built for this part I didn't know about.

:)

Tags
Gantt
Asked by
Vedad
Top achievements
Rank 3
Bronze
Bronze
Iron
Answers by
Ianko
Telerik team
Vedad
Top achievements
Rank 3
Bronze
Bronze
Iron
Share this question
or