| Page 1 of 1 | [ 3 posts ] |
|
I am using YUI 2.9 datatable. myDataSource.maxCacheEntries = 0 however in IE 8 it still pulls from the Cache. The first time in my application it does not pull from the Cache .. any subsequent tries will not make a round trip to the DB. I want it to go to the DB every time but it is pulling from the Cache. This is only doing this in IE 8. Firefox and Chrome are working correctly.
Here is my complete code: $.get('<%:Request.ApplicationPath.TrimEnd('/') %>/Home/getEmployeeList', function (data) { //take the JSON string coming from /home/getEmployeeList and parse it to a javascript object which is what YUI expects var obj = jQuery.parseJSON(data); YAHOO.example.ClientPagination = function () { // wanna create a custom formatter for the cell this.CustomLinkFormatter = function (elCell, oRecord, oColumn, oData) { var name = oRecord.getData("Name"); var UID = oRecord.getData("UID"); var hasNotes = oRecord.getData("hasNotes"); var noteString = ""; if (hasNotes == 1) { noteString = " | <a href='<%:Request.ApplicationPath.TrimEnd('/') %>/Form/Notes/" + UID + "'>***</a>"; } else { noteString = ""; } elCell.innerHTML = "<a href='<%:Request.ApplicationPath.TrimEnd('/') %>/Form/Index/" + UID + "'>View Forms</a>" + noteString + ""; // elCell.innerHTML = "<a href='<%:Request.ApplicationPath.TrimEnd('/') %>/Form/Index/" + UID + "'>View Forms</a>" + // " <a href='<%:Request.ApplicationPath.TrimEnd('/') %>/Form/reAssignManager/" + UID + "'>Manager Info</a>"; }; // Add the custom formatter to the shortcuts YAHOO.widget.DataTable.Formatter.linkFormatter = this.CustomLinkFormatter; var myColumnDefs = [ { key: "isAccepted", label: "Accepted?", sortable: false }, { key: "initiated", formatter: YAHOO.widget.DataTable.formatDate, label: "Initiated", sortable: true }, { key: "dateTime", formatter: YAHOO.widget.DataTable.formatDate, label: "Accepted", sortable: true }, { key: "orgName", label: "Organization", sortable: true }, { key: "lname", label: "Last Name", sortable: true }, { key: "fname", label: "First Name" }, { key: "Options", formatter: "linkFormatter" } ]; var myDataSource = new YAHOO.util.DataSource(obj); myDataSource.maxCacheEntries = 0; myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSARRAY; myDataSource.responseSchema = { fields: ["isAccepted", { key: "initiated", parser: "date" }, { key: "dateTime", parser: "date" }, "orgName", "lname", "fname", "UID", "hasNotes"] }; var oConfigs = { paginator: new YAHOO.widget.Paginator({ rowsPerPage: 10 }) //initialRequest: "results=3" ... not sure what this is for }; var myDataTable = new YAHOO.widget.DataTable("employee_content", myColumnDefs, myDataSource, oConfigs); return { oDS: myDataSource, oDT: myDataTable }; } (); }); Any help? |
|
Just FYI:
I don't know if this affects YUI or not but I put this in my code: <%@ OutputCache Location="None" %> and <% Response.CacheControl = "no-cache"; Response.AddHeader("Pragma", "no-cache"); Response.Expires = -1; Response.Cache.SetCacheability(HttpCacheability.NoCache); %> in my master page. Still doesn't work correctly. I don't want anything to cache to include the YUI component. So far this is only an IE 8 issue. Firefox and chrome makes a DB hit everytime I load the page which is correct. |
|
I am sure you would have solved the problem by now. I have joined the forum recently and have seen this post just now. But for this, simply add a bustCache=(new Date()).getTime() parameter to your URL. It will work fine in every browser. You should do it at "getEmployeeList?bustCache="+(new Date()).getTime(). The problem is not because of YUI, but because of cache of browser.
|
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group