Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有连接到 REST 服务的 DataGrid。我需要传递一些自定义 HTTP 标头(授权和其他)来获取操作。我怎样才能做到这一点?
数据存储是 JsonRestStore。
迟到总比没有好......这是一个解决方法;在 dojo.addOnLoad() 方法的开头添加这个函数。
dojo.xhrGet = function(args){// Workaround for Dojo's lack of support for custom headers args.headers = {userId:'xyz', requestedBy:'abc', requestedFrom:'123'}; return dojo.xhr("GET", args); };