As part of implementing the Button to the ribbon tool bar. I require the schema name in the Button java script file. So I am trying to use the following command to get the schema object.
$display.getView().getItem().getSchema();
The above command will return the schema object. But how to get the schema Title from the schema object. Please help me out in this. Thanks in advance. Early response is appreciated.
You need to load the item info by calling .load(true) on the schema object. Because (obvious) not all info is loaded because of performance reasons.
Since the .load() call is asynchronous, you have to use a callback function to 'know' when the loading is done.
You can use the following code to load the item and to read it's properties (code simplified):
var schemaObject = $display.getView().getItem().getSchema();
function loaded()
{
alert(schemaObject.getTitle());
}
$evt.addEventHandler(schemaObject, "load", loaded);
schemaObject.load(true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With