Hello, Jon,
This is a continuation of our previous communication.
Thank you for your detailed response.
Please see our recommendations and answers below:
updateData()
API call can be used to refresh the data in Flexmonster without clearing the user's current view settings.
Here is a code snippet for illustration:
var pivot = new Flexmonster({
container: "#pivot",
height: 600,
toolbar: true,
report: {
"dataSource": {
"type": "api",
"url": callbackFunction,
"index": "fm-product-sales"
},
...
}
...
});
//The client's dataset version
var datasetVersion = "";
function callbackFunction(request, successCallback, errorCallback) {
console.log("request >>> ;", request);
// add further logic here (for example, get the response from the server)
// refresh the data if the dataset version is outdated
if (datasetVersion != "" && datasetVersion != response.datasetVersion) {
datasetVersion = response.datasetVersion;
pivot.updateData({
"type": "api",
"url": callbackFunction,
"index": "fm-product-sales"
});
} else if (datasetVersion == "") {
datasetVersion = response.datasetVersion;
}
successCallback(response.response);
}
This way it is possible to track the dataset version used by the client and update it when needed.
report
, please see: https://www.flexmonster.com/doc/available-tutorials-report/
These reports can then be saved locally or to a remote data storage and loaded again later to view or continue working on them.
The reports can be saved either through the Save
Toolbar Tab or by using the save()
API call:
The previously saved reports can be loaded in the following ways:
3.1) Using the load()
API call
3.2) Using the setReport()
API call
Here are the corresponding guides for more information:
4.1) The list of Flexmonster API
4.2) Customizing the Toolbar
4.3) Customizing the context menu
For example, the desired formatting that you describe can be achieved with the customizeCell()
API call.
Here is a JSFiddle example showing how negative numbers can be formatted in parens using customizeCell
: https://jsfiddle.net/flexmonster/yp9ke1vu/
Please let us know if this helps.
As always, please feel free to reach out to us in case of questions.
Kind regards,
Vera
Hi Jon,
We are happy to let you know that new negativeNumberFormat
formatting property was added.
This is provided in the 2.8.7 version of Flexmonster: https://www.flexmonster.com/release-notes/
You are welcome to update the component. Here is our updating to the latest version guide for assistance: https://www.flexmonster.com/doc/updating-to-the-latest-version/
Please let us know if everything works fine for you.
Best regards,
Mykhailo