2

I have used angular ui-grid in my application and my page contains simple text box and validate button. usually we add some strings in the text box and clicks on validate button and those will get validated with some external service and display data in ui-grid

My logic is working like a champ but I see there is something which causes some confusion to users. lets say if I add something like "Event 87654" in my text box and click on validate button, it gets validated successfully from my service and display just as "Event 87654" in data grid. so thing is why ui grid eliminates multiple intermediate spaces in the given string automatically?? is it possible to avoid this elimination?? can anyone suggest me in the regard.

2
  • 1
    Maybe because in HTML several spaces are shown as one? Commented Apr 4, 2016 at 9:53
  • That is Standard HTML behavior. Place the text inside a <pre>...</pre> (preformatted text). Commented Apr 4, 2016 at 12:49

1 Answer 1

6

here is the solution.

UI grid eliminates multiple spaces and keep only one because white spaces are trimmed out by ui-grid-cell-contents css

So just we need to have override css like below.

 .ui-grid-cell-contents {
      white-space: pre !important; /*nowrap by default*/
   }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.