I have a table that contains client's stock holdings (portfolio). TableTools is used to let clients print/export/copy their holdings. Also Clients can change column orders and column size on the fly. I'm using ColReorderWithResize.js to achieve this. That's all Alright. I'm also using bSatetSave to remember their preferences. On page re-load or page refresh everything works. It remembers number of entries per page, sorted columns and so on. BUT it does not remember client's column order and column resize. Can anybody guide me on how to set this up? or I guess my question should be is this possible?
The code:
The code:
var portfolioItemsArray = new Array(22); portfolioItemsArray[0] = ["0","OPM","10","1PM PLC","<span class='warningMessage' >0.09p</span>","0.00p","£0.01","£0.22","<span class='warningMessage' >£-0.21</span>","B","B194YY1","23"]; portfolioItemsArray[1] = ["1","ABBY","1000","ABBEY PLC","<span class='warningMessage' >525.00p</span>","0.00p","£5","250.00","£4","025.00","<span class='warningMessage' >£1,225.00</span>","B","0002040","23"]; portfolioItemsArray[2] = ["2","AAIF","50","ABERDEEN ASIAN INC","<span class='warningMessage' >221.00p</span>","<span class='warningMessage' >-0.25p</span>","£110.50","£5.58","<span class='warningMessage' >£104.92</span>","B","B0P6J83","23"]; portfolioItemsArray[3] = ["3","AZN","140","ASTRAZENECA","<span class='warningMessage' >2","956.50p</span>","<span class='warningMessage' >47.50p</span>","£4","139.10","£4","298.96","<span class='warningMessage' >£-159.86</span>","B","0989529","23"]; portfolioItemsArray[4] = ["4","BIOM","13100","BIOE TECH","<span class='warningMessage' >0.07p</span>","0.00p","£9.17","£523.22","<span class='warningMessage' >£-514.05</span>","B","0581419","23"]; portfolioItemsArray[5] = ["5","CCE","10","CAMO CLEA","<span class='warningMessage' >2.00p</span>","<span class='warningMessage' >0.13p</span>","£0.20","£13.57","<span class='warningMessage' >£-13.37</span>","B","B11FB96","23"]; portfolioItemsArray[6] = ["6","CHAR","35","CHARIOT OIL & GAS","<span class='warningMessage' >27.25p</span>","0.00p","£9.54","£58.00","<span class='warningMessage' >£-48.46</span>","B","B2R9PM0","23"]; portfolioItemsArray[7] = ["7","ELE","1974","ELECTRIC WORD","<span class='warningMessage' >1.75p</span>","0.00p","£34.55","£101.00","<span class='warningMessage' >£-66.45</span>","B","0308362","23"]; portfolioItemsArray[8] = ["8","GKP","1252","GULF KEYS","<span class='warningMessage' >177.50p</span>","<span class='warningMessage' >0.75p</span>","£2","222.30","£2","528.52","<span class='warningMessage' >£-306.22</span>","B","B019X62","23"]; portfolioItemsArray[9] = ["9","HMV","10000","HMV GROUP","<span class='warningMessage' >1.75p</span>","<span class='warningMessage' >-0.15p</span>","£175.00","£0.00","<span class='warningMessage' >£175.00</span>","B","3157572","23"]; portfolioItemsArray[10] = ["10","IMI","10","IMI","<span class='warningMessage' >1","131.00p</span>","<span class='warningMessage' >34.50p</span>","£113.10","£100.78","<span class='warningMessage' >£12.32</span>","B","0457963","23"]; portfolioItemsArray[11] = ["11","JLT","500","JARD LLOYD","<span class='warningMessage' >780.00p</span>","<span class='warningMessage' >-9.50p</span>","£3","900.00","£0.00","<span class='warningMessage' >£3","900.00</span>","B","0520337","23"]; portfolioItemsArray[12] = ["12","JD.","500","JD SPRTS FSHN","<span class='warningMessage' >688.00p</span>","<span class='warningMessage' >7.75p</span>","£3","440.00","£3","685.78","<span class='warningMessage' >£-245.78</span>","B","0477154","23"]; portfolioItemsArray[13] = ["13","LLOY","1785","LLYD BKG","<span class='warningMessage' >49.76p</span>","<span class='warningMessage' >1.85p</span>","£888.22","£3","496.94","<span class='warningMessage' >£-2","608.72</span>","B","0870612","23"]; portfolioItemsArray[14] = ["14","MXP","1000","MAX PET","<span class='warningMessage' >3.70p</span>","<span class='warningMessage' >-0.10p</span>","£37.00","£140.64","<span class='warningMessage' >£-103.64</span>","B","B0H1P66","23"]; portfolioItemsArray[15] = ["15","","10000","OXONICA","0.00p","0.00p","£0.00","£0.00","£0.00","B","B0D09P4","23"]; portfolioItemsArray[16] = ["16","PHTM","10000","PHOTO ME INTL","<span class='warningMessage' >186.20p</span>","<span class='warningMessage' >2.80p</span>","£18","620.00","£7.09","<span class='warningMessage' >£18","612.91</span>","B","0848125","23"]; portfolioItemsArray[17] = ["17","QQ.","10000","QINETIQ GRP","<span class='warningMessage' >6","220.00p</span>","<span class='warningMessage' >272.50p</span>","£622","000.00","£18","362.00","<span class='warningMessage' >£603","638.00</span>","B","B0WMWD0","23"]; portfolioItemsArray[18] = ["18","RRS","1000","RANDGOLD","<span class='warningMessage' >98.00p</span>","<span class='warningMessage' >2.33p</span>","£980.00","£10","000.00","<span class='warningMessage' >£-9","020.00</span>","B","B01C3S3","23"]; portfolioItemsArray[19] = ["19","","3444","RBS","0.00p","0.00p","£0.00","£898.70","<span class='warningMessage' >£-898.70</span>","B","0754783","23"]; portfolioItemsArray[20] = ["20","RTO","10","RENTOKIL INITIAL","0.00p","0.00p","£0.00","£50.43","<span class='warningMessage' >£-50.43</span>","B","B082RF1","23"]; portfolioItemsArray[21] = ["21","RBS","1","ROYL BANK","<span class='warningMessage' >301.60p</span>","<span class='warningMessage' >7.40p</span>","£3.02","£3.02","£0.00","B","B7T7721","23"]; var oTable = jQuery('#pnlportfolioUK').show().dataTable({ "sDom": 'RT<"clear">lfrtip', "bStateSave": true, "aaData" : portfolioItemsArray, /* data already been fetched */ "aoColumns": [ { "sWidth": "5%", "sTitle": "RowId"}, { "sWidth": "6%", "sTitle": "Symbol"}, { "sWidth": "5%", "sTitle": "Qty"}, { "sWidth": "26%","sTitle": "Description"}, { "sWidth": "8%", "sTitle": "Price"}, { "sWidth": "7%", "sTitle": "Price Change"}, { "sWidth": "9%", "sTitle": "Market Value"}, { "sWidth": "9%", "sTitle": "Book Cost"}, { "sWidth": "9%", "sTitle": "Gain/Loss"}, { "sWidth": "6%", "sTitle": "Corp Action"}, { "sWidth": "5%", "sTitle": "depot"}, { "sWidth": "5%", "sTitle": "sedol"}], "oTableTools": { "aButtons": [ "copy", "print", "csv", "xls", "pdf"], "sSwfPath": "http://localhost:8090/hamidTest/swf/copy_csv_xls_pdf.swf" } });