How to Add records to grid on the fly

Hi

I have a grid that has no datasource attached to it.
The records are coming from a websocket in real time.
I am trying to add records from javascript using
var gridObj = $("#tbldxspots").data("ejGrid");
gridObj.addRecord({ "v_pinakida": splits[1], "v_vra"new Date(), "v_lat": splits[2], "v_lon": splits[3], "n_speed": iSpeed, "v_heading": splits[6], "v_temperature": splits[7], "b_engine": splits[8] });
Unfortunately I get a no datasource error
the grid is as follow
<ej-grid id="tbldxspots" allow-sorting=true allow-text-wrap=true allow-scrolling="true" enable-alt-row="true" >
                         <e-edit-settings allow-adding="true" allow-editing="true"></e-edit-settings>
 
                        <e-columns>
                            <e-column text-align=Left field="v_pinakida" header-text="Οχημα" width=200></e-column>
                            <e-column text-align=Left field="v_vra" header-text="Ωρα" format="{0:hh:mm dd MMM yyyy}"></e-column>
                            <e-column text-align=Right field="v_lat" header-text="Lat"></e-column>
                            <e-column text-align=Right field="v_lon" header-text="Lon"></e-column>
                            <e-column text-align=Right field="n_speed" header-text="Ταχύτης"></e-column>
                            <e-column text-align=Right field="v_heading" header-text="Κατεύθυνση"></e-column>
                            <e-column text-align=Right field="v_temperature" header-text="Θερμοκρασία"></e-column>
                            <e-column text-align=Right field="b_engine" header-text="Κινητήρας"></e-column>
                        </e-columns>
                    </ej-grid>
thank you in advance for the help
George









2 Replies

GR George Rossopoulos February 17, 2018 08:32 AM UTC

Hi

no need to answer found the solution.

Thank you
George


RS Renjith Singh Rajendran Syncfusion Team February 19, 2018 07:37 AM UTC

Hi George, 

Thanks for the update. 

We are happy to hear that your requirement has been achieved. 

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran. 


Loader.
Up arrow icon