Data getting trimmed in gridField

 Hi,

 

I have some data in my DB which contains spaces in between, but when I am trying to display same data using a!gridTextColumn that data is getting trimmed.

For e.g. I have data as "abc   ***   89" in DB but when I am displaying on form it is getting displayed as "abc *** 89"

I am not using trim function anywhere while displaying data.

 

Any suggestions to handle the above scenario.

Thanks in advance.

 

Regards,

Trunal Jain (TJ)

  Discussion posts and replies are publicly visible

Parents
  • Please find following :

    DB table with values : 

     

    Code snippet : 

    load(
    local!pagingInfo : a!pagingInfo(
    1,
    -1
    ),
    local!datasubset : a!queryEntity(
    entity : cons!TEST_EMP_DS,
    query : a!query(
    pagingInfo : local!pagingInfo
    )
    ),
    a!formLayout(
    firstColumnContents : {
    a!gridField(
    label : "Grid Field",
    totalCount : local!datasubset.totalCount,
    columns : {
    a!gridTextColumn(
    label : "ID",
    field : "id",
    data : index(
    local!datasubset.data,
    "id",
    {}
    )
    ),
    a!gridTextColumn(
    label : "Names",
    field : "ename",
    data : index(
    local!datasubset.data,
    "ename",
    {}
    )
    )
    },
    value : local!pagingInfo
    )
    }
    )

    )

     

    Output : 

     

    In the above screenshot you can see there is only one space left between words but in DB there are many spaces.

Reply
  • Please find following :

    DB table with values : 

     

    Code snippet : 

    load(
    local!pagingInfo : a!pagingInfo(
    1,
    -1
    ),
    local!datasubset : a!queryEntity(
    entity : cons!TEST_EMP_DS,
    query : a!query(
    pagingInfo : local!pagingInfo
    )
    ),
    a!formLayout(
    firstColumnContents : {
    a!gridField(
    label : "Grid Field",
    totalCount : local!datasubset.totalCount,
    columns : {
    a!gridTextColumn(
    label : "ID",
    field : "id",
    data : index(
    local!datasubset.data,
    "id",
    {}
    )
    ),
    a!gridTextColumn(
    label : "Names",
    field : "ename",
    data : index(
    local!datasubset.data,
    "ename",
    {}
    )
    )
    },
    value : local!pagingInfo
    )
    }
    )

    )

     

    Output : 

     

    In the above screenshot you can see there is only one space left between words but in DB there are many spaces.

Children
  • 0
    A Score Level 1
    in reply to TJ

    hi TJ

    i have tested it,its working fine for me,i have replaced with my entity in your code...

    load(

     local!pagingInfo: a!pagingInfo(

       1,

      -1

     ),

     local!datasubset: a!queryEntity(

       entity: cons!Test_Details,

       query: a!query(

         pagingInfo: a!pagingInfo(

           1,

           -1

         )

       )

     ),

     a!formLayout(

       label: "",

       contents: a!columnsLayout(

         columns: a!columnLayout(

           contents: {

             a!gridField(

               label: "Grid Field" & local!datasubset.data.name,

               totalCount: local!datasubset.totalCount,

               columns: {

                 a!gridTextColumn(

                   label: "iD",

                   field: "id",

                   data:

                     index(

                       local!datasubset.data,

                       "id",

                       {}

                     )

                 ),

                 a!gridTextColumn(

                   label: "Names",

                   field: "name",

                   data: index(

                     local!datasubset.data,

                     "name",

                     {}

                   )

                 )

               },

               value: local!pagingInfo,

               saveInto: local!pagingInfo

             )

           }

         )

       )

     )

    )

     

     

    which DB you are using?

  • We are using MSSql and I suppose you are working on 17.2. Currently I am working on 17.1

  • 0
    A Score Level 1
    in reply to TJ
    yes ,in 17.1 its not working,when we are showing data in expression rule its displaying fine,
    but when the same data is showing in interface(In text fields,in grid or label of any component )its showing only one space.