EasyUI Forum
October 12, 2025, 04:15:43 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: Problem in datagrid  (Read 7868 times)
MFS
Newbie
*
Posts: 47



View Profile
« on: February 22, 2017, 12:53:00 AM »

Hello.
I have problem in datagrid.
All work fine, but on one case I dont know how to show data from db in right format.
I use sqlsrv db.
I table I have one filed that contain some sample data code for page.
Code is:

Code:
<div class="fitem">   
<label>@@Caption@@</label>   
<input name="@@Name@@" id="@@Name@@" class="easyui-textbox" style="@@width@@" @@readonly@@  > 
</div>

When open page with datagrid that contain filed with code sample, in datagrid show input.
I want to see there only plain text, not component.
How to fix it?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: February 22, 2017, 08:12:36 AM »

Please define a 'formatter' function for the column to achieve this functionality.
Code:
function formatItem(value){
  var s = ...;
  s = s.replace(/</g,'&lt;');
  s = s.replace(/>/g,'&gt;');
  return s;
}
Logged
MFS
Newbie
*
Posts: 47



View Profile
« Reply #2 on: March 09, 2017, 03:26:45 AM »

Can you write sample?
I try this, but dosnt work at all.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: March 09, 2017, 03:43:51 AM »

Please look at this example http://code.reloado.com/ehedex3/edit#preview
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!