EasyUI Forum
May 16, 2024, 12:00:21 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: access text inside panel  (Read 4300 times)
crosemffet
Jr. Member
**
Posts: 68



View Profile WWW Email
« 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


View Profile Email
« 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  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!