Hi Alan,
Thanks for your feedback. I understand that for my columns to be sortable, the underlaying view must have sortable columns.
But, is there a way to have client side sorting only ?
I would like to populate a store once, and then be able to sort/filter client side. A refresh button will then repopulate the store and refresh the grid.
Is there a way to accomplish this ?
Also, any idea on how to get a hold on the REST service javascript object ? I've tried dijit.byid, but my variable is still undeclared.
I might need some casting ?
Code:
id="restServiceMail"
jsId="jsRestServiceMail"
>
defaultColumns="true"
var="entry"
viewName="xpMailByContactKey"
>
var storeID = null;
var MailStore = null;
var grid = null;
dojo.addOnLoad(function(){
var storeID = "#{id:restServiceMail}";
MailStore = dijit.byId(storeID);
alert(MailStore.id);
var layout = [
{ field: "icon", name: "icon" , width: "25px" },
{ field: "Subject", name: "Subject", width: "350px", formatter: formatMailLink },
{ field: "DocumentCategories", name: "Category", width: "400px" },
{ field: "DocumentCategories", name: "Folder", width: "300px" },
{ field: "Sent", name: "Sent/ Recieved", width: "150px" },
{ field: "Sent", name: "Sent by", width: "250px" }
];
function formatHTML(docUnid, rowIndex){
var linkVal = "link";
return linkVal;
}
grid = new dojox.grid.DataGrid({
query: { Subject: '*' },
store: MailStore,
clientSort: true,
autoHeight: 10,
autoWidth:true,
columnReordering: true,
noDataMessage: "No data matched the query",
onRowDblClick: function(evt) {
var index = grid.selection.selectedIndex;
var item = grid.getItem(index);
var store = grid.store;
var tmpUrl = "PersonFormXPage.xsp?documentId=" + store.getValue(item, 'docUnid') +"&action=openDocument";
if (this.getItem(evt.rowIndex).locked != "true") {
//alert(tmpUrl);
window.document.location = tmpUrl;
}
},
structure: layout
}, '#{id:gridNode}');
grid.startup();
});
function Hello(){
alert("Hello");
}
]]>
id="gridNode"
styleClass="DemoLeft"
>
Tips would be greatly appreciated :-) Thanks !
regards,
Petter