Rally: Collapse rows of rallygridboard - row

I create an rally taskboard app by using the following source code: https://github.com/RallyApps/app-catalog/tree/master/src/apps/taskboard
Now I want to set default value for collapsed property in rowConfig but it is not working. otherwise when I use setCollapsed for all rows by using this code:
var rows = this.down('rallycardboard').getRows();
rows[0].setCollapsed(true);
It's not working too. Anyone help me? Thanks

There is not currently a configuration property for controlling whether a row is expanded or collapsed on load (although they do remember their collapsed state once they are manually clicked on to collapse).
However you should be able to collapse them on load using code very similar to what you have above:
var board = this.down('rallycardboard'),
rows = board.getRows();
rows[0].collapse();

Related

Interactive Grid - JavaScript getValue

I’m struggling to obtain the new value that is being set in an editable Interactive Grid. I’ve created a dynamic action to be fired when the column has changed. The dynamic action is firing as expected, but it’s returning the previous value and not the value that triggered the event.
The dynamic action is set to execute JavaScript:
var $te = $(this.triggeringElement);
var rowID = $te.closest('tr').data('id');
var grid = apex.region('IG_SCALE_1').call('getViews','grid');
var model = grid.model;
var record = model.getRecord(rowID);
var column_val = model.getValue(record,”COLUMN_1”);
apex.item(“P1_HIDDEN_1”).setValue(column_val);
Let’s say column_1 had a value of 0 and that value was changed to 1. The code is setting the hidden item’s value to 0. I need it to be set to 1.
When I execute the following code I can see the old value in the array.
console.log(record);
Is there anything that I can do to obtain the new value?
Many thanks.. let me know if you have any questions!
You might be encountering one of the bugs, which are fixed in APEX version 19.2.
John Snyders described in his blog APEX IG Cookbook update for 19.2
One of the bugs had to do with changes to the last edited cell not always being saved.
A list of all fixed bugs in 19.2 is available here: APEX 19.2 Release Notes.
Search for 26963177 and 29132960 in particular.
Can you reproduce the issue in apex.oracle.com environment?

I want to turn this if formula into an array formula but cant seem to get it to auto populate down the rows

I want the driving distance between two address's and I am running a script that allows the following statement work.
This works but I have to drag the formula down when new rows are added from my mobile app into my sheet
=(IF(ISBLANK($AF2:$AF),"",DrivingMeters($E2:$E,$AF2:$AF)/1000))
This doesn't work
=ARRAYFORMULA(IF(ISBLANK($AF$2:$AF),"",DrivingMeters($E$2:$E,$AF$2:$AF)/1000))
I cant work out what I am doing wrong?
it could possible be you need to adjust your DrivingMeters custom formula to accept arrays. Please share the sheet or custom formula
try:
=ARRAYFORMULA(IF(AF2:AF="",, DrivingMeters(E2:E, AF2:AF)/1000))

How to disable edit mode of oracle apex interactive grid on double click?

I am using an interactive grid in oracle apex. When we double click the grid it goes into an edit mode. I want to get rid of this functionality because my grid is not editable this way.
if you don't want the user to be able to edit row content, change the column type under Report -> Columns -> Your column -> Type. For example try setting it to Display only so that the users cannot change the content.
I have been trying to replicate the same from a long time. Just found a workaround for this.
Create Dynamic Action on Interactive grid on event Double Click
Set Action = Execute JavaScript Code
Use following code in action
apex.region("emp").widget().interactiveGrid("getActions").set("edit", false);
Make sure to replace emp with static ID which you should provide in IG region.

Oracle/APEX Adding a row to an Interactive Grid with a Dynamic Action

Currently using APEX 5.1.4
My goal is to have the user press a button, which triggers a new row to be added to the bottom of the IG. This row would also need to have some default values pre-populated, such as the sequence column I have functioning as a primary key.
Doesn't matter how exactly, but I was considering doing it with Javascript. However, none of the methods I have found online, regarding adding a row with Javascript, work.
Also, I have the header bar of the IG removed, so finding the native Add Row Button probably is not an option.
--EDIT--
I found some Javascript that successfully allows me to add a row, however, it adds the row directly underneath the currently selected row. I do not see any methods to automatically select the last row of the IG, and it still doesn't solve that the row needs to have some dynamic values upon instantiation.
Here is the javascript:
This shows all of the available functions that can be invoked ( with .invoke() ):
apex.region("id-region-emp").widget().interactiveGrid("getActions").list()
These following lines both instantiate a new empty row on the IG:
("row-add-row" adds to top of IG, "insert-record" adds underneath currently selected row.)
apex.region("id-region-emp").widget().interactiveGrid("getActions").invoke("row-add-row")
apex.region("id-region-emp").widget().interactiveGrid("getActions").invoke("insert-record")
Better to use below code:
apex.region("detaildataset").widget().interactiveGrid("getActions").invoke("selection-add-row");
Before applying this code make interactiveGrid editable by clicking on attributes and also apply primary key on one column and then apply this code in Execute javascript code:
apex
.region("detaildataset")
.widget()
.interactiveGrid("getActions")
.invoke("selection-add-row");

Ultragrid entire column selection when header is clicked

This might seem a very easy problem but I am stuck and can't find a way out of it. I am using ultragrid in my form with several columns. My issue is when I am trying to click on the column header I am expecting my entire column to be selected but it doesn't. I assumed the SelectTypeCol is the property for my column selection but it did not work either. I also tried to add each column to Selected.Columns collection like this UltraGrid1.DisplayLayout.Bands(0).Columns(i).Header.Selected = True but it didn't work for me either. I believe Selected is only available during runtime but not at the design mode.
So if there is an easier way to make this work, please let me know.
Thank you
You are looking for the property HeaderClickAction
grid.DisplayLayout.Override.HeaderClickAction = HeaderClickAction.Select
This will automatically flip the selection state of the entire column as Selected (or Delected) when you click on the header. Of course this means also that you loose the ability to automatically sort on all columns
You can programmatically set the Selection state of a column with code like this (C#)
grid.DisplayLayout.Bands[0].Columns["youColumnKey"].Header.Selected = true;
this will permit to leave the HeaderClickAction property to SortSingle or SortMulti, but you have to handle the situation using code and appropriate events
You need to have an InitializeLayout event on your grid. in this event you need to set the chekboxsynchronization to default and it should work here is sample code
private void ultraGrid1_InitializeLayout(object sender,
Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
{
e.Layout.Bands[0].Columns.Add("CheckBox");
e.Layout.Bands[0].Columns["CheckBox"].Style = ColumnStyle.CheckBox;
e.Layout.Bands[0].Columns["CheckBox"].Header.CheckBoxVisibility = HeaderCheckBoxVisibility.WhenUsingCheckEditor;
e.Layout.Bands[0].Columns["CheckBox"].Header.CheckBoxSynchronization = HeaderCheckBoxSynchronization.Default; <-- make sure it is set to default here
}