Hello. I'm trying to add a custom item to the data returned by the server for a picklist and I can't figure it out. Basically the dataSource provides a collection of options and I want to insert a new item at position 0 called "All".
I'm trying to use dataArrived to intercept the data returned by the server. The last argument, data, is of type ResultSet and according to the documentation should implement the List interface, along with the add and addAt methods. However, that is not the case, calling those methods results in a Javascript error saying those methods are not defined.
Alternatively I tried using transformData on the data object, but the data is not modified in any way.
I figure there's also the problem of increasing the number of totalRows and the endRow so I might need some help with that too.
Meanwhile, can anyone help me with this?
Thanks
I'm trying to use dataArrived to intercept the data returned by the server. The last argument, data, is of type ResultSet and according to the documentation should implement the List interface, along with the add and addAt methods. However, that is not the case, calling those methods results in a Javascript error saying those methods are not defined.
Code:
dataArrived : function (startRow, endRow, data) { data.addAt({name: "All", value:"All"}, 0); }
Code:
dataArrived : function (startRow, endRow, data) { data.transformData = function (data, dsResponse) { data.addAt({name: "All", value:"All"}, 0); return data; } }
Meanwhile, can anyone help me with this?
Thanks
Comment