EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
April 29, 2024, 05:21:15 AM
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
EasyUI Forum
>
General Category
>
General Discussion
>
EasyUI and Socket.IO
Pages: [
1
]
« previous
next »
Print
Author
Topic: EasyUI and Socket.IO (Read 8836 times)
ahybits
Newbie
Posts: 26
EasyUI and Socket.IO
«
on:
January 25, 2016, 05:57:42 AM »
HI,
I was wondering if I can get some ideas on how to accomplish the following:
I have a grid with 5 columns and around 30 rows. I need the last column to be real time. As a workaround, i have been using setInterval, but that loads the whole data (of course I can create another function to get just the data for the last column and update each row, but was hoping to find a way to use Socket.IO instead
How can i leverage realtime data with the datagrid?
Logged
stworthy
Administrator
Hero Member
Posts: 3581
Re: EasyUI and Socket.IO
«
Reply #1 on:
January 25, 2016, 08:23:12 PM »
You can call 'updateRow' method to update datagrid rows when receiving the data from the server.
Code:
socket.on('customevent', function(data){
// parse data;
$('#dg').datagrid('updateRow', {
...
})
})
Logged
ahybits
Newbie
Posts: 26
Re: EasyUI and Socket.IO
«
Reply #2 on:
January 26, 2016, 12:43:22 PM »
Do you think I should still use the url: parameter for the datagrid to get the initial data and then jsut run the socket.on for updaterow
or
load all data via socket and then run updateRow as needed ?
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> News
=> General Discussion
=> EasyUI for jQuery
=> EasyUI for Angular
=> EasyUI for Vue
=> EasyUI for React
=> Bug Report
Loading...