Search Support
-
Mahesh GollamudiDecember 21, 2017 at 10:27 am #4856
BPM Version : 8.6
I currently have a table control(BPM UI toolkit) bound to list of expenditureItem and I need to populate the sum total of each column on the table column header and was looking for any API methods that are exposed to reload the header when there is an onChange event on the cell.
Even though I was able to achieve this using the unexposed proto methods , I was hoping this method be exposed on to the api so that the future upgrades of these controls wont cause any issue .Are there any alternative methods or approaches?
1.Updating the cspecs with
<tablecontrolId>._instance.cspecs[6].label = “Item Total:80”
2.Reloading the table header
<tablecontrolId>._proto._reloadHeader(<tablecontrolId>);
Thanks & Regards,
Mahesh Gollamudi
SPARK SupportDecember 21, 2017 at 3:44 pm #4857Hi Mahesh,
You should be able to get the column specs from the context options, set the result to a variable, modify the needed property and set the value using
table.context.options.columnSpecs.get(“value”) and table.context.options.columnSpecs.set(“value”, <variable>)
The change handler should trigger the reload of the header automatically.
Regards,
Stephen P.
Mahesh GollamudiDecember 27, 2017 at 12:23 pm #4862Hi Stephen ,
Thank you for your recommendation , have tried and I am getting the error .My understanding from your statement is that the default table change handler will reload the table(includes header) when there is an update on the header information .My guess from the error is ,the listener is failing to detect the change.
var cSpecs = expenditure.context.options.columnSpecs.get(“value”);
cSpecs.items[1].label = cSpecs.items[1].label +”:”+”BLAHBLAH”;
expenditure.context.options.columnSpecs.set(“value”,cSpecs);//Result
Error on change event [/]: TypeError: Unable to get property ‘binding’ of undefined or null reference
Call stack: TypeError: Unable to get property ‘binding’ of undefined or null reference
at _2f0.ui._isViewBound
at constructor.prototype.change
at _44d.callViewLifeCycleAPI
at _f81.prototype._change
at _f81.prototype._bindingChanged
at Anonymous functionThanks & Regards
Mahesh Gollamudi
Mahesh GollamudiDecember 27, 2017 at 12:27 pm #4863Is there any way i can edit the post , i didn’t want the url info on this 🙂
Thanks & Regards
Mahesh GollamudiSPARK SupportDecember 27, 2017 at 1:01 pm #4864Hi Mahesh;
You may need to create a list variable of type TableColumn and bind this to the Columns configuration option.
Then initialize the variable with the desired specifications before attempting to use the .get and .set methods on the context option.
Regards,
Stephen P.
Mahesh GollamudiDecember 27, 2017 at 1:53 pm #4865Hi Stephen,
I have tried that ,still no luck.Getting the same error .
Thanks & Regards,
Mahesh Gollamudi
SPARK SupportDecember 28, 2017 at 10:00 am #4892Hi Mahesh,
The URLs have been removed from your post per your request.
I have tested this code with BPM version 8.6:
table = page.ui.get(“Table1”);
cspecs = table.context.options.columnSpecs.get(“value”).items;
cspecs[0].label = “Something Different”;
table.context.options.columnSpecs.set(“value”,cspecs);The Table Columns configuration option must be bound to a variable list of type TableColumn with default values instantiated:
var autoObject = [];
autoObject[0] = {};
autoObject[0].renderAs = “V”;
autoObject[0].visibility = “V”;
autoObject[0].sortable = false;
autoObject[0].options = “”;
autoObject[0].css = “”;
autoObject[0].width = “”;
autoObject[0].label = “Name”;
autoObject[1] = {};
autoObject[1].renderAs = “V”;
autoObject[1].visibility = “V”;
autoObject[1].sortable = false;
autoObject[1].options = “”;
autoObject[1].css = “”;
autoObject[1].width = “”;
autoObject[1].label = “Department”;
autoObjectRegards,
Stephen P.
Mahesh GollamudiDecember 28, 2017 at 11:13 am #4893Thank you Stephen,
//Not Working
cols = expenditure.context.options.TableColumns.get(“value”);
cols.items[1].label = cols.items[1].label +”:”+sum;//Working
cols = expenditure.context.options.TableColumns.get(“value”).items;
cols[1].label = cols[1].label+”:”+sum;the difference is the way am updating the label ,a JS object vs List ,thank you for your valuable feedback.
Is there a place where we can find some documentation on the API.For some reason I couldn’t find these methods documented else where other than in the IE debugger window.
Thanks & Regards
Mahesh Gollamudi
Mahesh GollamudiDecember 28, 2017 at 11:49 am #4894I think it is more correct to say setting a list vs JS object made the difference.
Thanks & Regards
Mahesh Gollamudi
SPARK SupportDecember 28, 2017 at 12:10 pm #4895Hi Mahesh,
table.context.options.columnSpecs.get(“value”).items simply returns the value of the configuration option defined in the Table coach view. We have provided a internal method to handle any changes to this value. Changes to Coach View context options is covered by IBM documentation here:
Regards,
Stephen P.
-
|
You must be logged in to reply to this topic.