< is the html code for < symbol, it's a "feature" of the code editor here in the Community:)
As for ModifierType
We have access to items that will be displayed in the grid and their position will be the same as in the response.collection.collection.items. You can pass response to the performStylesChange method and process it there as well and perform the check for the needed ModifierType and change styles only for those records.
Something like:
define("CaseSection", [], function(){return{
entitySchemaName:"Case",
messages:{},
attributes:{},
diff:/**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,
methods:{
onGridDataLoaded: function(response){this.callParent(arguments);this.performStylesChange(response);},
performStylesChange: function(response){
var processedItemsIndexes =this.checkResponseCollection(response);
var recordTitles = document.getElementsByClassName("grid-primary-column");for(var i =0; i < recordTitles.length; i++){for(var j =0; j < processedItemsIndexes.length; j++){if(processedItemsIndexes[j]== i){
var element = recordTitles[i];
element.style.fontWeight='bold';}}}},
checkResponseCollection: function(response){
var responseItems = response.collection.getItems();
var processItemsIndexes =[];for(var i =0; i < responseItems.length; i++){if(responseItems[i].values.Status.displayValue=="New"){
processItemsIndexes.push(i);}}return processItemsIndexes;}}};});
Here I marked tickets in the New status in bold text:
Could you please clarify which step exactly you have problems with?
Was it possible for you to make the text bold without conditions?
If so then how exactly do you add the specific field value?
Thank you for your interest. I have overridden 2 methods:
initQueryColumns: function(esq){this.callParent(arguments);
esq.addColumn("ModifiedBy.Type.Id", "ModifierType");},
prepareResponseCollection: function(collection){this.callParent(arguments);// Аor each record returned in the query for the list // check the Amount field value and then apply style
collection.each(function(item){if(item.get("ModifierType")=="00783ef6-f36b-1410-a883-16d83cab0980"){
item.customStyle= Ext.apply(item.customStyle||{}, {"background-color":"#FFFFCC",
"font-weight":"bold"});}}, this);}
I understand that I need to change this part of the code:
define("CaseSection", [], function(){return{
entitySchemaName:"Case",
messages:{},
attributes:{},
diff:/**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,
methods:{
onGridDataLoaded: function(response){this.callParent(arguments);this.performStylesChange();},
performStylesChange: function(){
var recordTitles = document.getElementsByClassName("grid-primary-column");for(var i =0; i < recordTitles.length; i++){
var element = recordTitles[i];
element.style.fontWeight='bold';}}}};});
The logic here is simple: once grid data is loaded we go through all elements on the page and change the style for the text to bold to all title columns (which is a case number). This is not the best solution, but it works properly when the list is loaded or sorting\filtering is changed in the list.
Hello. Here is an example. It uses jQuery, but you may easily adapt it to Oleg's example. Main idea is that items[i] is viewModel coresponding to recordTitles[i] DOM element from Oleg's example.
applyCustomCss: function(){
var gridData =this.getGridData();
var items = gridData.getItems();
var uiItems = $("div[column-name='ColorByProductType']");for(var i =0; i < items.length; i++){
var height = $(uiItems[0]).css("height");
var bgColor;
var category = items[i].get("Product.SxGoodsCategory").value;if(category === SxProductConstants.GoodsCategory.Wine){
var wineColor = items[i].get("Product.SxColor").value;if(wineColor === SxProductConstants.WineColor.Red){
bgColor ="#cc0a0a";}elseif(wineColor === SxProductConstants.WineColor.White){
bgColor ="gold";}elseif(wineColor === SxProductConstants.WineColor.Pink){
bgColor ="pink";}}elseif(category === SxProductConstants.GoodsCategory.Champagne){
bgColor ="bisque";}elseif(category === SxProductConstants.GoodsCategory.StrongAlcoholDrink){
bgColor ="saddlebrown";}elseif(category === SxProductConstants.GoodsCategory.Water){
bgColor ="blue";}
$(uiItems[i]).css({"background-color": bgColor,
"border-radius":"50%",
"vertical-align:":"middle",
"margin-top":"7px",
"margin-right":"2px",
"width": height});}},
And instead of oveeriding initQueryColumns method it is better to override getGridDataColumns
getGridDataColumns: function (){
var baseGridDataColumns =this.callParent(arguments);
var gridDataColumns ={"ModifiedBy.Type.Id":{path:"ModifiedBy.Type.Id"}};return Ext.apply(baseGridDataColumns, gridDataColumns);},
< is the html code for < symbol, it's a "feature" of the code editor here in the Community:)
As for ModifierType
We have access to items that will be displayed in the grid and their position will be the same as in the response.collection.collection.items. You can pass response to the performStylesChange method and process it there as well and perform the check for the needed ModifierType and change styles only for those records.
Something like:
define("CaseSection", [], function(){return{
entitySchemaName:"Case",
messages:{},
attributes:{},
diff:/**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,
methods:{
onGridDataLoaded: function(response){this.callParent(arguments);this.performStylesChange(response);},
performStylesChange: function(response){
var processedItemsIndexes =this.checkResponseCollection(response);
var recordTitles = document.getElementsByClassName("grid-primary-column");for(var i =0; i < recordTitles.length; i++){for(var j =0; j < processedItemsIndexes.length; j++){if(processedItemsIndexes[j]== i){
var element = recordTitles[i];
element.style.fontWeight='bold';}}}},
checkResponseCollection: function(response){
var responseItems = response.collection.getItems();
var processItemsIndexes =[];for(var i =0; i < responseItems.length; i++){if(responseItems[i].values.Status.displayValue=="New"){
processItemsIndexes.push(i);}}return processItemsIndexes;}}};});
Here I marked tickets in the New status in bold text:
Thank you very much. With your help to solve this problem. It also gave me some insight into working with section entries via JavaScript. Also, if you don't mind, tell me how to compare the "Contact Type" lookup value in the : "ModifiedBy" field. Something like "ModifiedBy.Type.Id". Thank you again.
What I did here is add the Owner.Type column in the Cases section esq (Case has an Assignee (which is the Owner column that references the Contact entity) and I need to check the contact type specified in this column). As a result
we have access to this OwnerType in the context of the onGridDataLoaded and performStylesChange execution. We can also use it for style recalculation. In your case it should be similar but using another column.
At this moment we have the Product set on the Opportunity Page. This Product is filtered based on some field: Client Type, Standard Destination, Loan Category and others. The filtration of the Product was done based on 3 matrixes and code.
Now I need to reconfigure this Product to work based on the same fields but set up as Parameters. I've done this for all the Products, but now I don't know how to connect the Parameters with the field on the Opportunity Page. I've also added Conditions.
Unfortunately, as of now, there is no such possibility.
But thank you so much for your idea. We've registered it in our R&D team backlog for consideration and implementation in future application releases. Thank you for helping us to improve our product.
There is a possibility to select several conditions in the selection in the 8.0.8 version:
But this should be also available in the previous versions. You need to update your app to 8.0.8 and then you will be definitely able to select conditions needed.
But if we are talking about two separate columns then indeed there is no such possibility in the current application versions. I will register a suggestion for our R&D team to implement one. Thank you for helping us in making the app better!
if we are talking about two separate columns then indeed there is no such possibility in the current application versions. I will register a suggestion for our R&D team to implement one. Thank you for helping us in making the app better!