report control is
[{"reportId":2028,"fieldName":"companyName","reportStatus":"Icon","columnType":1},{"reportId":2028,"fieldName":"onlineURL","reportStatus":"Hidden","columnType":2}]
I don't need display data for column name company Name only .
How I do that ?
Expected result as you see below company name is empty :
It looks like you have started to do some debugging - console.log (but having it after the return statement makes me think you have some very basic lack of knowledge)
What debugging are you doing? What do you learn? Do you understand the controller method? Is it being called? Does it give the right results? If not, why not? What are the actual parameters being passed? What are the internal variable values in the
method? What is being returned?
Member
41 Points
376 Posts
How to make column Name company without data based on field Name and Column Type?
Jul 11, 2020 02:10 PM|ahmedbarbary|LINK
I work on angular 7 app I face issue : I can't make column Name company Name display Empty or without
data where field Name of report Control json is Company Name and column type=1
report control is table have field Name AND column Type .
Based on Field Name value and column Type=1 I will hide or not display data to column Assigned to Field Name .
stack blitz I work on it as below and it have all data related and code :
On component.ts
repcon return data for report control as below :
I don't need display data for column name company Name only .
How I do that ?
Expected result as you see below company name is empty :
Participant
1660 Points
952 Posts
Re: How to make column Name company without data based on field Name and Column Type?
Jul 13, 2020 12:49 AM|PaulTheSmith|LINK
Move the logic out of the template and into the controller.
Create a method in the controller which determines what string to display based on the raw string and the column name, something like
The template then becomes
(You could do it all in the template but it is best to have the template concerned with display and the controller to be concerned with logic)
You can use a similar method to control display of the column header.
Member
41 Points
376 Posts
Re: How to make column Name company without data based on field Name and Column Type?
Jul 13, 2020 02:40 PM|ahmedbarbary|LINK
Thank you for reply
stackblitz exist above if you can test on it .
it seems your solution is good but I test it and not work and no data display on all fields
I put function on controller and on html i do code as below ;
Member
41 Points
376 Posts
Re: How to make column Name company without data based on field Name and Column Type?
Jul 13, 2020 02:50 PM|ahmedbarbary|LINK
I hope any one help me
Participant
1660 Points
952 Posts
Re: How to make column Name company without data based on field Name and Column Type?
Jul 13, 2020 11:50 PM|PaulTheSmith|LINK
Your template has code that my example does not have.
What do you have in the controller? There is an error in it.
Member
41 Points
376 Posts
Re: How to make column Name company without data based on field Name and Column Type?
Jul 14, 2020 12:28 AM|ahmedbarbary|LINK
Thank you for reply result I need as below :
Member
41 Points
376 Posts
Re: How to make column Name company without data based on field Name and Column Type?
Jul 14, 2020 12:37 AM|ahmedbarbary|LINK
I do as code you write above
put my function on controller (component.ts)
and component.html
i write I do on html above
Participant
1660 Points
952 Posts
Re: How to make column Name company without data based on field Name and Column Type?
Jul 15, 2020 02:06 AM|PaulTheSmith|LINK
It looks like you have started to do some debugging - console.log (but having it after the return statement makes me think you have some very basic lack of knowledge)
What debugging are you doing? What do you learn? Do you understand the controller method? Is it being called? Does it give the right results? If not, why not? What are the actual parameters being passed? What are the internal variable values in the method? What is being returned?