Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DataSourceField length attribute question for read-only DataSources

    Hello Isomorphic,

    I just had to change the database field length for a field I use in one table and very many views. I adjusted this for all the .ds.xml for the views as well. This is tedious and error prone manual work.

    My question: Is there a reason to have the length attribute for read-only DSFields? Is it used for display calculations as well (e.g. ListGridField-width)? Or can I just omit it for read-only (from a SmartGWT point of view) fields?
    Of course I looked in the docs before and it seems the attribute is used for editing/storing to database, only.

    Thank you and Best regards
    Blama
    Last edited by Blama; 6 May 2015, 02:57.

    #2
    The length attribute is optional whether the field is read-only or not.

    Comment


      #3
      Hi Isomorphic,

      thanks for answering. Perhaps I was not clear:
      I know that length is an optional attribute. I wanted to know if it has any influence on readOnly-fields. The main usage affecting readWrite-fields is listed in the docs.

      Possible usage I could think of is display calculations for ListGridField-width.

      If it has no effect for readOnly data, I'd omit it for all .ds.xml targeting a database-VIEW.

      Best regards
      Blama

      Comment


        #4
        Yes, it influences some default size calculations. See for example the docs for listGrid.autoFitExpandField.

        Comment


          #5
          Hi Isomorphic,

          ok, thank you. I'll keep and maintain the attribute then.

          Best regards
          Blama

          Comment


            #6
            Hi Isomorphic,

            as enhancement suggestion:
            When you use includeFrom="someDS.someField" in .ds.xml and the included field has a length attribute, you seem not to copy that information, currently.
            As it seems you copy/infer other information (like type), I suggest to copy the length information as well. This would save some RegExp search and copy&paste-maintaining for users that want to maintain this information and should benefit all other users silently.

            I did not create an extra thread as this seems to target the exact same are of the framework.

            Best regards
            Blama

            Comment


              #7
              Hi Isomorphic,

              while editing I noticed that the same is true for escapeHTML (but I do not know if you copy that already).

              Best regards
              Blama

              Comment


                #8
                Hi Isomorphic,

                sorry, please disregard the last two posts. I configured my ListGrid wrong.

                Best regards
                Blama

                Comment

                Working...
                X