Get selected row id in quasar framework datatables - vue.js

I want to delete row from quasar-framework datatable, so I want to pass selected row(s) id to a delete function to be able to make axios request to delete data with these id(s), but I don't know how to pass these id(s) to my delete function. How to get only selected id ?

Add selection properties, for example <q-table :data="tableData" :selection="single" :selected.sync="selectedRow"> on q-table and in data function add property selectedRow = []. In this property you will have array index of selected row from tableData.

Related

JOGET - Update form field through Datalist

I am new in Joget. I need some help.
I have one form (CRUD). It's datalist like as below:
Now, I want to update status when I will click on assign button then selected checkbox's status value will be update to Assigned.
Thanks.
what you can do is set create a hyperlink against the row in datalist on that action you can either use JDBC or dormant record plugin to update status.

Devexpress GridView count selected rows

I have a Devexpress Data Grid with a number of rows loaded.
The following properties are set:
MultiSelectNode=CheckBoxRowSelect
MultiSelect=True
I have a function that iterates through all the Rows and checks, gridview1.IsRowSelected(x) = True.
However the problem is, that even with the checkbox selected is checked it never shows as true.
The following code returns 0
Debug.Print(GridView1.GetSelectedRows().Count)
Is there an easy way to check if the checkbox is checked?
Thanks
the following piece has been working for me in various parts of my app:
First specify the key field name which your datasource collection uses:
<dvx:ASPxGridView ID="xgvGrid" runat="server"
KeyFieldName="ID" ... >
...
</dvx:ASPxGridView>
Then access selected rows IDs by:
...
List<object> values = xgvGrid.GetSelectedFieldValues("ID");...
You can obtain the selected row's count by calling values.Count afterwards.
HTH
Upon closer examination of the code a refresh method was being called which interfered with the grid .getselectedrowsmethod.

Getting the value of comboxbox in ExtJS

I am using ExtJs 4.1. My page is having a combobox and a button. The comboxbox is having a store which uses a model having 4 fields (UserName,ID (uniqueID),Age,Salary). Name is used as display field and Id is used as value field.
What i want:
When the button is clicked I want to see the selected value in the comboxbox and I want to extract the salary.
Possible solution: Get the id of the selected value from the combobox and find the record in the store and extract the salary for that record.
I was wondering if there is more direct approch or method exposed by ExtJS
on combobox select you can get the salary value like this:
onComboboxSelect: function(combo, records, options) {
var selectedValue=combo.getValue();
var record = combo.findRecord(combo.valueField || combo.displayField, selectedValue);
alert(record.get('salary'));
}
I think this is the important then you can for example save this value and display it when the button is clicked..

Select an Ext.Picker field by default

I've created a Picker in a form in my sencha app. The field is empty by default. How do I set it to be selected on the first item in the data array?
It automatically selects the first item in data array (node 0) ... if the first item is empty and you want it to be on the 2nd item you can (assuming a the component variable is called picker) use picker.items.items[0].setSelectedNode(1)

Getting selected item from combobox itemrenderer and storing in object

I have a combo box itemrenderer in datagrid column. I want to get the user selected item from the dropdown of the row(s) (User may select values from combo box from multiple rows of datagrid) and corresponding values of all other columns of the rows and store it in an object . Then pass this object to database to update only those rows that user has changed.
I am able to get the selected item from combo box using "event.currentTarget.selectedItem" and corresponding values of all other columns of the rows using "valueSelect.ID", etc where valueSelect is object which contains data for datagrid. But am stuck with, how to store the selected item value of the combobox and corresponding values of all other columns of the rows into an Object?
I am seeking sample code to store selected item from combobox and its corresponding values of all other columns into an object which I can send to db.
If you're using Flex, you can bind the selectedItem property / object of the DataGrid to an Object (of the "type" used to render the ItemRenderer).
Or you can do it manually, store a reference to that object by declaring an Object (or some specific type) and then updating that value whenever a selection occurs.
So for example :
[Bindable]public var selectedItem:Object;
...
public function onComboBoxChanged(evt:ListEvent):void
{
selectedItem = dataGrid.selectedItem;
...
// comboBox specific logic here
...
}
That or, if you need something complex, possibly check out this post for a custom item renderer :
Flex DataGrid with ComboBox itemRenderer
Hope that helps!