EasyUI
Home
Demo
Tutorial
Documentation
Download
Extension
Contact
Forum
EasyUI Forum
May 16, 2024, 12:00:21 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
>
EasyUI for jQuery
>
access text inside panel
Pages: [
1
]
« previous
next »
Print
Author
Topic: access text inside panel (Read 4300 times)
crosemffet
Jr. Member
Posts: 68
access text inside panel
«
on:
January 19, 2016, 05:07:38 PM »
hello everybody, and thanks in advance for your support.
I need to add some text inside panel (for chat application).
each time a new chat message is received, the panel should refresh its content adding the new message.
for the first message, I use:
$('#mypanel').panel({content: 'first message'});
this works ok.
the problem is, when a second message comes, I need to add it to the current content...
so, how should I write the code to add the new content to the existing one...?
or maybe gets the current content to add it in a variable, make the sum and then apply it...?
thanks for your support !.
Logged
jarry
Administrator
Hero Member
Posts: 2264
Re: access text inside panel
«
Reply #1 on:
January 20, 2016, 01:50:27 AM »
You just need to call 'append' to append message.
Code:
$('<p>first message</p>').appendTo('#mypanel');
$('<p>second message</p>').appendTo('#mypanel');
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...