Sort on Category field with Alias











up vote
0
down vote

favorite













We need to replace 'Post Category Name' with 'UserAlias' on several pages in our CMS. One issue that arises and needs to be taken into consideration is that if the Post Category attribute on the FE is replaced with UserAlias, the sort functionality coming from the BE will not be applicable.



The issue explained above is in case if for example we have four Categories with names (aName, bName, cName and dName) with some of the Categories with set both the Alias(set by CMS Admin but not visible to the user) and UserAlias(set by User and visible on FE) attributes, some of the Categories with set only one of these attributes and the other is (null) and finally some of the Categories both of the attributes set to (null) - in that case the possible issues that would emerge if we sort by a particular attribute are as follows:



Example of list of 4 Categories with set values for Alias/userAlias/Name.
As a clarification the order of the arguments by which the arrangements names are displayed as defined by the FE logic (in Angular) and are as follows: userAlias | alias | name and if there is null value of the attribute it will be placed on top in Sort ASC. In that case possible scenarios for sorting by a partical attribute are as follows:



Category



id name userAlias AS-IS Sort by name TO-BE Sort by Alias



1 aName Alias Selection Alias Selection (null)bName



2 bName (null) bName (null)Gross clasified alias



3 cName Temp data Temp data Alias Selection



4 dName (null) Gross clasified alias Temp data



Explanation:


Sort by Name ASC – default view:


aName has UserAlias fileld so Alias Selection is first


bName does not have set UserAlias and Alias so name bName is used and bName is second


cName has UserAlias so Temp data is third


dName does not have UserAlias but does have an Alias so Gross Classified Alias is fourth



- Sorting is not performed by ASC order i.e. the current functionality is broken…

Sort By userAlias ASC:


bName - value for UserAlias field is (null) and is on top - as Alias is also null – bName is used as first


dName - value for UserAlias field is (null) but does have an Alias with value Gross Classified Alias so Gross Classified Alias is second


aName – value for UserAlias field is Annual Saving i.e. has set UserAlias so Alias Selectionis third


cName - value for UserAlias field is Temp data i.e. has set UserAlias so Temp data is fourth


  • Sorting is not performed by ASC order i.e. the current functionality is broken…


Need help to implement alias but keep the sorting functionality (Perhaps a new type of sort that will sort over the three fields simultaneously – can it be done in Angular???










share|improve this question


























    up vote
    0
    down vote

    favorite













    We need to replace 'Post Category Name' with 'UserAlias' on several pages in our CMS. One issue that arises and needs to be taken into consideration is that if the Post Category attribute on the FE is replaced with UserAlias, the sort functionality coming from the BE will not be applicable.



    The issue explained above is in case if for example we have four Categories with names (aName, bName, cName and dName) with some of the Categories with set both the Alias(set by CMS Admin but not visible to the user) and UserAlias(set by User and visible on FE) attributes, some of the Categories with set only one of these attributes and the other is (null) and finally some of the Categories both of the attributes set to (null) - in that case the possible issues that would emerge if we sort by a particular attribute are as follows:



    Example of list of 4 Categories with set values for Alias/userAlias/Name.
    As a clarification the order of the arguments by which the arrangements names are displayed as defined by the FE logic (in Angular) and are as follows: userAlias | alias | name and if there is null value of the attribute it will be placed on top in Sort ASC. In that case possible scenarios for sorting by a partical attribute are as follows:



    Category



    id name userAlias AS-IS Sort by name TO-BE Sort by Alias



    1 aName Alias Selection Alias Selection (null)bName



    2 bName (null) bName (null)Gross clasified alias



    3 cName Temp data Temp data Alias Selection



    4 dName (null) Gross clasified alias Temp data



    Explanation:


    Sort by Name ASC – default view:


    aName has UserAlias fileld so Alias Selection is first


    bName does not have set UserAlias and Alias so name bName is used and bName is second


    cName has UserAlias so Temp data is third


    dName does not have UserAlias but does have an Alias so Gross Classified Alias is fourth



    - Sorting is not performed by ASC order i.e. the current functionality is broken…

    Sort By userAlias ASC:


    bName - value for UserAlias field is (null) and is on top - as Alias is also null – bName is used as first


    dName - value for UserAlias field is (null) but does have an Alias with value Gross Classified Alias so Gross Classified Alias is second


    aName – value for UserAlias field is Annual Saving i.e. has set UserAlias so Alias Selectionis third


    cName - value for UserAlias field is Temp data i.e. has set UserAlias so Temp data is fourth


    • Sorting is not performed by ASC order i.e. the current functionality is broken…


    Need help to implement alias but keep the sorting functionality (Perhaps a new type of sort that will sort over the three fields simultaneously – can it be done in Angular???










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite












      We need to replace 'Post Category Name' with 'UserAlias' on several pages in our CMS. One issue that arises and needs to be taken into consideration is that if the Post Category attribute on the FE is replaced with UserAlias, the sort functionality coming from the BE will not be applicable.



      The issue explained above is in case if for example we have four Categories with names (aName, bName, cName and dName) with some of the Categories with set both the Alias(set by CMS Admin but not visible to the user) and UserAlias(set by User and visible on FE) attributes, some of the Categories with set only one of these attributes and the other is (null) and finally some of the Categories both of the attributes set to (null) - in that case the possible issues that would emerge if we sort by a particular attribute are as follows:



      Example of list of 4 Categories with set values for Alias/userAlias/Name.
      As a clarification the order of the arguments by which the arrangements names are displayed as defined by the FE logic (in Angular) and are as follows: userAlias | alias | name and if there is null value of the attribute it will be placed on top in Sort ASC. In that case possible scenarios for sorting by a partical attribute are as follows:



      Category



      id name userAlias AS-IS Sort by name TO-BE Sort by Alias



      1 aName Alias Selection Alias Selection (null)bName



      2 bName (null) bName (null)Gross clasified alias



      3 cName Temp data Temp data Alias Selection



      4 dName (null) Gross clasified alias Temp data



      Explanation:


      Sort by Name ASC – default view:


      aName has UserAlias fileld so Alias Selection is first


      bName does not have set UserAlias and Alias so name bName is used and bName is second


      cName has UserAlias so Temp data is third


      dName does not have UserAlias but does have an Alias so Gross Classified Alias is fourth



      - Sorting is not performed by ASC order i.e. the current functionality is broken…

      Sort By userAlias ASC:


      bName - value for UserAlias field is (null) and is on top - as Alias is also null – bName is used as first


      dName - value for UserAlias field is (null) but does have an Alias with value Gross Classified Alias so Gross Classified Alias is second


      aName – value for UserAlias field is Annual Saving i.e. has set UserAlias so Alias Selectionis third


      cName - value for UserAlias field is Temp data i.e. has set UserAlias so Temp data is fourth


      • Sorting is not performed by ASC order i.e. the current functionality is broken…


      Need help to implement alias but keep the sorting functionality (Perhaps a new type of sort that will sort over the three fields simultaneously – can it be done in Angular???










      share|improve this question














      We need to replace 'Post Category Name' with 'UserAlias' on several pages in our CMS. One issue that arises and needs to be taken into consideration is that if the Post Category attribute on the FE is replaced with UserAlias, the sort functionality coming from the BE will not be applicable.



      The issue explained above is in case if for example we have four Categories with names (aName, bName, cName and dName) with some of the Categories with set both the Alias(set by CMS Admin but not visible to the user) and UserAlias(set by User and visible on FE) attributes, some of the Categories with set only one of these attributes and the other is (null) and finally some of the Categories both of the attributes set to (null) - in that case the possible issues that would emerge if we sort by a particular attribute are as follows:



      Example of list of 4 Categories with set values for Alias/userAlias/Name.
      As a clarification the order of the arguments by which the arrangements names are displayed as defined by the FE logic (in Angular) and are as follows: userAlias | alias | name and if there is null value of the attribute it will be placed on top in Sort ASC. In that case possible scenarios for sorting by a partical attribute are as follows:



      Category



      id name userAlias AS-IS Sort by name TO-BE Sort by Alias



      1 aName Alias Selection Alias Selection (null)bName



      2 bName (null) bName (null)Gross clasified alias



      3 cName Temp data Temp data Alias Selection



      4 dName (null) Gross clasified alias Temp data



      Explanation:


      Sort by Name ASC – default view:


      aName has UserAlias fileld so Alias Selection is first


      bName does not have set UserAlias and Alias so name bName is used and bName is second


      cName has UserAlias so Temp data is third


      dName does not have UserAlias but does have an Alias so Gross Classified Alias is fourth



      - Sorting is not performed by ASC order i.e. the current functionality is broken…

      Sort By userAlias ASC:


      bName - value for UserAlias field is (null) and is on top - as Alias is also null – bName is used as first


      dName - value for UserAlias field is (null) but does have an Alias with value Gross Classified Alias so Gross Classified Alias is second


      aName – value for UserAlias field is Annual Saving i.e. has set UserAlias so Alias Selectionis third


      cName - value for UserAlias field is Temp data i.e. has set UserAlias so Temp data is fourth


      • Sorting is not performed by ASC order i.e. the current functionality is broken…


      Need help to implement alias but keep the sorting functionality (Perhaps a new type of sort that will sort over the three fields simultaneously – can it be done in Angular???







      sorting alias






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 7 at 12:11









      Daniel BT

      11




      11





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53189231%2fsort-on-category-field-with-alias%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53189231%2fsort-on-category-field-with-alias%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini