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???
sorting alias
add a comment |
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???
sorting alias
add a comment |
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???
sorting alias
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
sorting alias
asked Nov 7 at 12:11
Daniel BT
11
11
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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