Incorporating a custom Dojo widget into my OnDemandGrid is proving to be quite the challenge. Each widget's data is sourced from a Solr query, and with potentially thousands of search results expected, I've turned to JsonRest for querying and pagination management. Here's my current setup:
The store:
var store = new JsonRest ({
target: "/solr/json/response",
});
Setting up the grid:
var grid = new (declare([OnDemandGrid, Pagination])) ({
store: store,
getBeforePut: false,
columns: [
{
label: "Test",
field: "first",
renderCell: myRenderFunction //Custom widget rendering function
}
]
}, "grid");
grid.startup();
myRenderFunction:
var myRenderFunction = function(object, data, cell) {
var widget = new MyCustomWidget({
doc: object,
foo: bar
}, cell.appendChild(document.createElement("div"));
widget.startup();
return widget;
}
A snippet of the Solr response in JSON format:
{
"response":{
"docs":[
{
"foo": "Hello",
"bar": "World"
},
{
"foo": "Easy as",
"bar": "ABC"
},
{
"foo": "Simple as",
"bar": "Do re mi"
}
]
},
"highlighting": { ... },
"numFound": "74",
"start": 0
}
Despite following tutorials successfully, attempting to render the widget onto the grid results in nothing appearing and gives a
TypeError: transform(...) is null
. What could be causing this issue?
Why won't my custom widget show up on the grid?