EasyUI Forum
May 08, 2024, 11:48:52 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: Datagrid Bug - multiple blank spaces in text are removed in columns [not a bug]  (Read 10145 times)
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« on: June 16, 2014, 01:23:51 AM »

In datagrid columns the json-text contains multiple blanks for e.g. "Stefan    B" but it is shown as "Stefan B". This is wrong when we search using the filter or show original customer data.

You can see the bug on demo page: http://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=default&dir=ltr&pitem=
Test with column 'Attribute '
« Last Edit: July 01, 2014, 04:51:10 AM by Stefan B. » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: June 16, 2014, 05:50:35 AM »

Many browsers render only a space when encounter a series of spaces and tabs. A possible solution to solve this issue is to apply 'white-space:pre' style.
Code:
<style>
.datagrid-cell{
  white-space:pre;
}
</style>
Logged
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« Reply #2 on: June 16, 2014, 06:14:47 AM »

OK THX. That's very tricky. So it was not a bug - sorry
Should this set to default in EasyUi datagrid style?
Logged
wade.zhu
Newbie
*
Posts: 27


View Profile
« Reply #3 on: June 16, 2014, 06:32:50 PM »

i agree with Stefan B.
in my project, i have to use lots of
Code:
formatter : function(value, row, index){
    return htmlEncode(value);
}
to avoid HTML characters

so, why not add a new property on datagrid column, something like
Code:
{
title : 'Desc',
field : 'desc',
htmlEncode : true
}
Logged
wade.zhu
Newbie
*
Posts: 27


View Profile
« Reply #4 on: June 16, 2014, 07:11:59 PM »

not only datagrid, also consider combobox, etc.
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!