We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Option to turn off whitespace trimming in edited grid cells

Thread ID:

Created:

Updated:

Platform:

Replies:

130952 Jun 13,2017 08:08 AM UTC Jun 14,2017 09:42 AM UTC JavaScript 1
loading
Tags: ejGrid
Robert David
Asked On June 13, 2017 08:08 AM UTC

Hello, we've got a grid where we want to display the whitespace that the user has input.

Currently the grid is trimming the whitespace when the user saves (or cancels an edit) of a cell that has leading whitespace.
Is there an option to disable this trim?

I've attached a gif of the current behaviour.

Attachment: WhiteSpaceTrimmedOnSave_a6fb6065.zip

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On June 14, 2017 09:42 AM UTC

Hi Robert,  
 
Thanks for contacting Syncfusion Support. 
 
By default, wrapping will not be applied to the Grid. Henceforth, the Grid content will trim the leading white-spaces. To overcome this, we must customize the Grid cells by white-space CSS property. We have included the cssClass property to add this customization as shown in the following code example.  
 
       <style> 
              .e-grid.noWrap .e-rowcell { 
                     white-space: pre-wrap !important; 
              } 
       </style> 
     <div id="Grid"></div> 
    <script type="text/javascript"> 
        $(function () { 
            $("#Grid").ejGrid({ 
                dataSource: window.gridData, 
                allowPaging: true, 
                cssClass: "noWrap", 
                editSettings: { allowEditing: true, allowAdding: true, allowDeleting: true }, 
                  .. .  
                      . . . 
            }); 
        }); 
    </script> 
 
 
 
Refer to the following API References.  
 
 
We have prepared a sample demo.  
 
 
Regards,  
Seeni Sakthi Kumar S. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;