How do i disable and enable dropdownlist item based on a user selection on another dropdownlist - sapui5

I have layout row which contains a dropdown, textfield and two buttons to add and remove rows.
My requirement is i have 10 items in dropdownlist if select one item (say Item1) and click on add row button, a new row will be created as same as first row. Now in the second row dropdownlist items i want to disable the selected item of previous dropdownlist item (Item1).
And i if change the dropdown item of first row to Item3 then automatically in the second row dropdown item it(Item1) should be enabled and vice versa.
How can i do this.
Please help me on this.
Thanks
Sathish

There are probably more ways to do it, but I would store the selected items in an array and store that in your client model.
Then bind the enabled property of your dropdown template to a formatter function which returns false or true, depending on whether the template item is in the selected array or not

Related

Separate row selection from row checkbox selection?

Does ag-grid support separating row selection from checked checkboxes?
My users need to select a row (click on it, or keyboard nav) to see further details about the row. Then they need to check the checkbox (or not) to select the row for later export to Excel.
So for example, they'll click every row to see the further details, but only check some of the checkboxes for later export. Is this supported?
If not, what would be a good approach to implement? Add my own checkboxes to the first column?
You can set suppressRowClickSelection to true when you want checkbox selection, and don't want to also select when the row is clicked. If true, rows won't be selected when clicked.
You can read more about this here - https://www.ag-grid.com/javascript-grid-selection/
You can use ag-Grids selection capabilities for the checkbox selection and then use the onRowClicked prop to do a different select on row click. I'm doing just this (but with onRowDoubleClicked.
You still want to set suppressRowClickSelection to true.

Retrieve row data on checkbox selection in Ag-grid

I want to retrieve the row data on checkbox selection. Currently in ag-grid, on selecting a row we can retrieve the row data. Or we can do a multi row select, so rows details can be retrieved. So is there any way to retrieve the row data on checkbox selection. Or multiple rows data on checkboxes selection.
you need to use Row Selection
https://www.ag-grid.com/javascript-grid-selection/?framework=javascript#gsc.tab=0
You may use this onSelectionChanged: onSelectionChanged property or
onRowSelected: rowSelectedFunc

show the detail of a row in celltable

the requirement is easy, but I don't know how to do it.
there is a celltable with a column of radio button (or check box but only allow select one row), after user select that row, there is a button and user can click that button to see the detail of that row.
How to do it?
I try to SingleSelectionModel, but I assume the user origin select row 3 radiobutton, then the row3 underlying field is set to true, then when user select the row 5 radiobutton, the row 5 corresponding field is set to true, but I have no method to set the previously row 3 selected field to false.
There is no method to do it automatically. you have to do it yourself by applying a loop. use field updater on that column and get the value on basis of that set the value of other check boxes or radiobuttons. you can get all other elements by this code:
GridReportFields ldp=dataGrid.getVisibleItem(rowNo);
here GridReportFields is my model class. now u have object of corresponding rowNo you can set value of any variable of that object. like:
ldp.setCheckBoxValue(true);
here setCheckBoxValue() is a setter method of model class.

showing list on text change event

I am using VS 10 and SQL Server 2008. I want to show popup-list on text box change event, such that user can select from the list. This list will show 3 columns of particular table.
User should be able to select a particular item from the list and that selected record will be extracted in form fields.
How can I create such a pop-up list? and call it on text-change event?
you can use Popup and ListView.Set ListView as child of Popup control.3 columns can set as Listview sub items(3 subitems in a ListView Item).In text changed event your textbox, show pop-up control.

table with multiselection and clickable row

I already have a table - CellTable, with single selection model and i used onSelectionChange to find when row was clicked
Next I added to that column which containes check box
and here comes my problem
if i use single selection model, when i tick one row, other row become unticked
i tried to switch to multiselection model, but in this case, i can't click on row, and onSelectionChanges is executed only when i click on my check box, but i can tick more than one box
is any chance how i can have both - multiselection and clickable row?
regards
Yes it is possible.
But I am suprised that it doesn't work because the default behavior of the MultiSelectionModel should be that the row is selected as soon as you click it. However maybe in the presence of a CheckBoxCell column it is different.
Anyways you have to check following JavaDocs:
Constructor of the CheckboxCell
DefaultSelectionEventManager