How to add menu to the particular row selected? - html

I have a p-contextmenu and p-table, I want to menu should be visible only when that particular row is selected. Right now with the below code once a row is selected, I am able to view the menu options on row right click, due to my condition: if(this.rowSelected)==null;
Html file:
<p-contextMenu #cm [model]="items" appendTo="body"></p-contextMenu>
<p-table #dt [(selection)]="rowSelected" [value]="listOfRows" [contextMenu]="cm" [dataKey]="id" [columns]="columns" (contextmenu)="onContextMenuSelect($event,cm)">
Ts file:
onContextMenuSelect(event,contextMenu){
if(this.rowSelected==null){
contextMenu.hide();
}
}
This only checks whenever a row is selected then on right click of any rows menu appears, I want to make it sure that for that particular row itself right click menu should appear and on right click of other row but without selection menu shouldnt appear.

Related

paper-dropdown-menu - how to collapse dropdown menu when repeat a selection

When you repeat the same selection item, already selected, the dropdown menu remains open. I would like to collapse the menu as it occurs when you select a different item. You can check this behavior in the demo. How can I modify the element to collapse the menu in any case?. Thanks.
The paper-dropdown-menu has an 'opened' property. You can listen on click of the dropdown content and if opened is true, set it to false.

Show/Hide Column Header on Toggle in SSRS

I am working on a requirement that allow me to show columns when a user clicks on "+" (expand a row), and hides the column when a user clicks on "-" collapse a row.
So for example, when all rows are collapsed, report looks like:
When a user click on A to expand the a row in the report, then report should look like
Please note that COL4 only shows up when a row expands.
I have tried to set the visibility properties but the result I am getting like
If I am trying to set the header textbox properties getting an error like.
"toggle item must be the text boxes that share the same scope as hidden item or are in a scope that contains the hidden item, and cannot be contained within the report item unless current grouping scope has a parent"
I am Using Matrix Table
The problem is that clicking on a Col1 toggle will only be able to hide elements contained within your table grouping (which doesn't include the header of your col2) and you will see the error you mention above, "toggle item must be the text boxes that share the same scope...".
You can place a textbox outside of your table area and that will be able to toggle the column visibility, but that would expand the values for all col1 one grouped values and will not be what you are looking for. Unfortunately you cannot do exactly what you are looking for; the best option is the one you show above.

Toggle table visibility w/ click

I have a ssrs simple table with a text box above it.
I want to add an image with an expand collapse option, and initially when the report is show hide the table, and when the image is clicked show and continue to toggle everytime it is clicked.
For example:
Initially:
After Click:
The image name is expand_collapse, the table name is error_table. I know I need to right an expression for the visibility properties of error_table, I have not found anything with a click.
You can do it by checking the toggle display box:
Set the name of the text box containing your Error(8) statistics from the dropdown.
This creates a little +/- box that looks like this when collapsed:
And like this: when uncollapsed.
The "When the report is initially run" option sets the state when the report is first run, so if you want it to be collapse to start, select "Hide" as I've done above.

Primefaces update cell value of a editable Datatable taking value from a dialog

I have a requirement like this:
Display an editable table(implemented)
In the edit mode, display a button next to the first cell of the row(implemented)
on click of the button, open a dialog.(implemented)
Dialog will have a data table with radio buttons. (implemented)
Select one row and click on save button on the dialog. (implemented)
on the dialog, selected row's first cell value should come and sit as the cell value of the home screen's editing row (the one displayed in point#2).
I could implement all the points mentioned above except the point# 6. On click of save button on the dialog, dialog closes as expected but it is not updating on the home screen's editing cell.
if someone can provide a code snippet to exactly update the editing row's cell, that will be a great help!

DropDown menu with ClickEvent

When I click a button, then a drop down menu must be shown. When I click anywhere in the page it, needs to hide. The problem I have is here: when I run the page, I can see the drop down menu instead of the click event. I tried with different div tags, but to no effect.
Demo: http://jsfiddle.net/Navya/69KGD/
You need to set your dropdown list visibility to false (to hide it) when page loads.
$("#container").hide();
After that, when you click the button you set visibility to true (show it).
$("#container").show();