Page 1 of 3
aligning texts in chat page
Posted: Thu Jan 16, 2014 5:34 pm
by cvc
I'm adding a chat page to my app I would like to filter current user messages to the right and received messages to the left. here is what I've done:
var lc = localStorage.getItem('currentUserName');
var user = $('table').find('div_chat_authorField').text();
if (lc == user) {
$('table').find('div .messageDiv').removeClass('left').addClass('rightfloatRight');}
It's not working. What I', I doing wrong?
aligning texts in chat page
Posted: Thu Jan 16, 2014 6:13 pm
by Kateryna Grynko
Hi,
What components are used for messages? Are they in grid?
aligning texts in chat page
Posted: Thu Jan 16, 2014 6:23 pm
by cvc
Yes its in a grid who's name is messageDiv which is in another grid called outerDiv. I want to float messageDiv to the right of the outerDiv
aligning texts in chat page
Posted: Thu Jan 16, 2014 7:27 pm
by Kateryna Grynko
If you mean a big grid (messages list) and another one inside (a message itself) you can check this grid message and add to it CSS attribute prefloat: right;/pre or prefloat: left;/pre
aligning texts in chat page
Posted: Thu Jan 16, 2014 7:37 pm
by cvc
I want to add a class that floats the messageDiv base on the username. here is what I've tried:
var lc = localStorage.getItem('currentUserName');
var user = $('table').find('div_chat_authorField').text();
if (lc == user) {
$('table').find('div .messageDiv').removeClass('left').addClass('rightfloatRight');}
It's not working. How do I select specific user from the array?
aligning texts in chat page
Posted: Thu Jan 16, 2014 8:02 pm
by cvc
I solved it by adding a javascript in the mapping to target the parent div and add the class to it. Thanks
aligning texts in chat page
Posted: Thu Jan 16, 2014 8:08 pm
by Kateryna Grynko
Thank you for the update! Glad you solved it.
aligning texts in chat page
Posted: Thu Jan 16, 2014 8:31 pm
by cvc
But how can I implement infinite loading? I'm on that.
aligning texts in chat page
Posted: Thu Jan 16, 2014 10:02 pm
by cvc
Hi Katya
Please can you suggest how to implement infinite scrolling?
aligning texts in chat page
Posted: Thu Jan 16, 2014 10:28 pm
by Kateryna Grynko
Did you search in Internet? You could try this solution: https://github.com/kpheasey/jqm.infin...
Let us know if this helps.