I have overlay in which I am having one list component.
I am selecting multiple list items from that.
I am pressing OK button and my overlay is getting disappeared.
Now What I want is :
When I open that overlay again , I want those previously selected items highlighted.
I want to do this in sencha touch.
When you open your overlay again, previously selected items should be shown or highlighted.
As per my understanding, When you click on Ok button, You would be passing selected values as extra parameter in store to load it again.
so, when you open that overlay again, you would have those extraparams in the store...so, you can do below things. I am sure, It will work.
var store = Ext.getStore('storeId'),
selectedItems[],
selectedRec,
selectedRecs = [],
extraparameter = store.getProxy().extraParameters;
You can get selected transaction types like this.
selectedItems = extraparameter.selectedItems
Ext.Array.each(selectedItems , function(selectedItem) {
selectedRec = multiSelect.getStore().findRecord('transaction_type', transactiontype);
selectedRecs.push(selectedRec);
});`
Thanks !
Related
I have a window containing a list. When more than one item is highlighted I want a button to become visible to be pushed over another button. If it goes back to one or none highlighted I want the button to be disabled and the previous button to be shown again.
Currently I have a OnParentNotify function
if(message = LBUTTONDOWN)
int count = pMyListControl->GetSelectedCount();
if(count>1)
{
pTotalBox->ShowWindow(SW_HIDE);
pCheckBut->ShowWindow(SW_SHOW);
count=0;
}
else
{
pTotalBox->ShowWindow(SW_SHOW);
pCheckBut->ShowWindow(SW_HIDE);
count = 0;
}
This approach is working somewhat. If I click one item, nothing happens, as wanted. But if I select 2, nothing happens still. It isn't until I select another, after selecting at least 2, that it works correctly.
So I understand it is only getting the count of items prior to being clicked. I need it to get items already selected, AND items selected when performing a click.
I have an interactive grid with a bunch of records, and I want to set up a button on the page that changes one column in all records currently selected.
Running APEX 18.2, the IG has a whole bunch of columns and I want to change just one of them, but on a whole bunch of rows, so I do need a button.
The IG has ROWID as PK because the actual PK is assembled from 4 different columns.
I have spent some time googling this issue and have found a couple people with solutions:
http://thejavaessentials.blogspot.com/2017/03/getting-selected-rows-in-oracle-apex.html
This is the first, and simplest solution. But it doesn't return any rowid or anything like that, it returns the value in the first column.
Then I also found
http://apex-de.blogspot.com/2018/09/update-several-rows-in-tabular-form-grid.html
and
https://ruepprich.wordpress.com/2017/03/23/bulk-updating-interactive-grid-records/
Which are pretty similair and seem to be the best for me, but I get a Javascript error in the console: http://prntscr.com/n5wvqj
And I dont really know much Javascript, so I dont know what went wrong or how to best fix it.
I set up a Dynamic action on button click that executes Javascript and I have the selected element being the region named CUR_STAT.
var record;
//Identify the particular interactive grid
var ig$ = apex.region("CUR_STAT").widget();
//Fetch the model for the interactive grid
var grid = ig$.interactiveGrid("getViews","grid");
//Fetch the model for the interactive grid
var model = ig$.interactiveGrid("getViews","grid").model;
//Fetch selected records
var selectedRecords = apex.region("CUR_STAT").widget().interactiveGrid("getViews","grid").view$.grid("getSelectedRecords");
//Loop through selected records and update value of the AVT_OBR column
for (idx=0; idx < selectedRecords.length; idx++)
{
//Get the record
record = model.getRecord(selectedRecords[idx][0]);
// set Value for column AVT_OBR on "D"
model.setValue(record,"AVT_OBR", 'D');
}
The column named AVT_OBR is a select list with display values(DA, NE) and return values(D, N). But I tried having it be a text field and it didnt help.
I want to be able to select multiple columns and change the data in those entries.
If possible I would also like to be able to change data in such a way in a hidden column. Or if I could get all the ROWIDs for selected records and execute a PLSQL block with them.
Ended up with noone responding so I spent a lot of time and finally came up with a solution.
var g = apex.region('myIG').widget().interactiveGrid('getViews','grid');
var r = g.getSelectedRecords();
for(i = 0; i < r.length; i++) {
g.model.setValue(r[i], 'myColumn', 'Value');
}
For some reason none of the solutions I found had worked. But I learned from those solutions and made this simple piece of code that does what I need.
Also, I was wanting to set up so I could do this set value on a hidden column, I achieved this by just having the column visible and editable, but then when running the page I clicked on the column and hid it, and set the current view as the default report.
If anyone stumbles upon this question, I hope it helps.
Assume we have a XamDataGrid with 10 columns.
Column 1 is a XamComboEditor bound to a collection in the model
This can't be changed, the data is coming from a server and the combo's collection is based on different selections within the model so it's very dynamic.
Columns 2 - 10 are just normal alpha numeric fields
The problem:
When you enter a alpha numeric and start typing the model is initialized and everything is fine. However, if you go to the very last row, the non-initialized empty one, and click on the combo editor before entering any data into any of the other fields, the combo editor is empty.
Now I am well aware of why this is happening, it's clear that this is due to the model not being initialized yet. I'm just not sure the best method to fix this.
I would hope there is a property on the XamDataGrid that adjusts when the record is initialized but I've searched the Infragistics documentation and examples and I can't find anything.
There are events for:
EditModeStarting
EditModeStarted
EditModeEnding
EditModeEnded
private void OnCellEditModeStarting(object sender, EditModeStartingEventArgs args)
{
if (args.Cell.Field.Name == "TotalQuantity")
{
DataRecord record = args.Cell.Record;
if (record == null)
return;
MyGridEntry item = record.DataItem as MyGridEntry;
// Do a thing
}
}
You can also respond to the InitializeRecord event. It can fire for multiple reasons, such as cell editing, so check the state of your row model when responding to it. All these events are on the parent grid, not any FieldLayouts or Fields.
<i:XamDataGrid x:Name="myGrid"
InitializeRecord ="OnInitializeRecord"
EditModeStarting ="OnEditModeStarting">
I have a dialog list which use Use View dialog for Choices.
I have a row in a table which its appearing depends on the value selected from that dialog list. ( I am using Hide when formula... ) The form has Automatically refresh fields checked.
The problem is that after I select a certain value from the dialog list, and I even had selected Refresh fields on keyword change property, I MUST hit F5 or just TAB ( to go to a next field ) in order to make that row table to appear. I also tried to add uidoc.Refresh at the Exiting/OnChange event(s) of the dialog list.
I have noticed the following:
the refresh works fine for combo box, list box, radio button or check box
the refresh works fine for dialog list where you are using a list of choices / formula.
the refresh doesn't work for dialog list where you are using view dialog for choices ( my case ).
Is there any solution for this issue? I want when I selected a value from the dialog list, immediately the row / line should appear/disappear.
Thank for your time!
I want to create a QTreeWidget where the items are both editable and launchable. I want it to behave like Windows Explorer:
Single click -> selection
Single click on a previously selected item -> open LineEdit to edit the name
Double click -> perform the 'launch'
So I created slots for itemClicked() and itemDoubleClicked(). The first one is the following:
def EditName(self, item, column):
if self.lastclick == item:
self.editItem(item)
self.lastclick = item
The second one just 'launches' the file.
However, this kind of solution doesn't distinguish between a double click and two consecutive clicks, so the QLineEdit still appears after a double click. Is it possible to get rid of the editor forcibly? I tried a hack solution like hiding and showing the item but it didn't work.
You just need to set flags on your QTreeWidgetItem to include the ItemIsEditable option, and set the edit triggers on the QTreeWidget for SelectedClick
def populate( self, tree ):
tree.setEditTriggers(tree.SelectedClicked)
for i in range(10):
item = QTreeWidgetItem(['Testing %02i' % i])
item.setFlags(item.flags() | item.ItemIsEditable)