{"action":"created","issue":{"url":"https://api.github.com/repos/nicolaskruchten/pivottable/issues/280","labels_url":"https://api.github.com/repos/nicolaskruchten/pivottable/issues/280/labels{/name}","comments_url":"https://api.github.com/repos/nicolaskruchten/pivottable/issues/280/comments","events_url":"https://api.github.com/repos/nicolaskruchten/pivottable/issues/280/events","html_url":"https://github.com/nicolaskruchten/pivottable/issues/280","id":54659218,"number":280,"title":"Adding on-the-fly derivers","user":{"login":"horner","id":6094599,"avatar_url":"https://avatars.githubusercontent.com/u/6094599?v=3","gravatar_id":"","url":"https://api.github.com/users/horner","html_url":"https://github.com/horner","followers_url":"https://api.github.com/users/horner/followers","following_url":"https://api.github.com/users/horner/following{/other_user}","gists_url":"https://api.github.com/users/horner/gists{/gist_id}","starred_url":"https://api.github.com/users/horner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/horner/subscriptions","organizations_url":"https://api.github.com/users/horner/orgs","repos_url":"https://api.github.com/users/horner/repos","events_url":"https://api.github.com/users/horner/events{/privacy}","received_events_url":"https://api.github.com/users/horner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-01-17T11:35:23Z","updated_at":"2015-01-18T22:37:13Z","closed_at":null,"body":"I am attempting to add on-the-fly driver in the UI.\r\n![screen shot 2015-01-17 at 6 28 16 am](https://cloud.githubusercontent.com/assets/6094599/5788664/500b059a-9e12-11e4-9ba1-28c48a2767e1.png)\r\n\r\nThe coffescript:\r\n<code>\r\n   btns.append $(\"<button>\", {type:\"button\"}).html(opts.localeStrings.yearOnly).bind \"click\", ->\r\n      opts.derivedAttributes[c+' Year'] = $.pivotUtilities.derivers.dateFormat(c, \"%y\")\r\n      valueList.toggle(0, refresh)\r\n</code>\r\nNotice, the refresh...  of course this does not work because the pivotUI refresh does not make the UI again.  Is there a preferred way to accomplish a complete refresh of the UI?  I figured, a refactor to make refresh render the UI components would be painful.  I wondered if this was handled somewhere... maybe by reloading the entire DIV.  Any ideas would be helpful."},"comment":{"url":"https://api.github.com/repos/nicolaskruchten/pivottable/issues/comments/70429880","html_url":"https://github.com/nicolaskruchten/pivottable/issues/280#issuecomment-70429880","issue_url":"https://api.github.com/repos/nicolaskruchten/pivottable/issues/280","id":70429880,"user":{"login":"horner","id":6094599,"avatar_url":"https://avatars.githubusercontent.com/u/6094599?v=3","gravatar_id":"","url":"https://api.github.com/users/horner","html_url":"https://github.com/horner","followers_url":"https://api.github.com/users/horner/followers","following_url":"https://api.github.com/users/horner/following{/other_user}","gists_url":"https://api.github.com/users/horner/gists{/gist_id}","starred_url":"https://api.github.com/users/horner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/horner/subscriptions","organizations_url":"https://api.github.com/users/horner/orgs","repos_url":"https://api.github.com/users/horner/repos","events_url":"https://api.github.com/users/horner/events{/privacy}","received_events_url":"https://api.github.com/users/horner/received_events","type":"User","site_admin":false},"created_at":"2015-01-18T22:37:13Z","updated_at":"2015-01-18T22:37:13Z","body":"The problem is persisting the opts with the functions since they cannot be serialized in JSON.\r\n\r\nI have a modification of http://nicolas.kruchten.com/pivottable/examples/onrefresh.html that allows the opt object to be named and shared among several users using the same page by storing it server side.  Its very cool because it behaves like a shared filter in a google spreadsheet where one user can update the view and all users using the same named opt see the changes. \r\n\r\nI don't know of another way to securely share the opt between browsers using javascript.  By making a serializable derived attribute spec, it can be shared and persisted for use later.\r\n"}}