1

A couple years ago a former colleague added ext components, specifically the Combobox, to a project I maintain. Now I am trying to add a google drive picker to allow users to select items from google Drive. After a user loads the google picker, if he/she then interacts with the combobox, the results will not correctly be displayed, despite the XHR request returning the data properly. I see in the boundlist.js file where it creates the XTemplate object but not where it applies it to each record in the store...

Combobox results display before and after utilizing the google drive picker

Has anybody dealt with this issue or something similar? Is there a way to avoid conflicts between the two JS libraries?

Sᴀᴍ Onᴇᴌᴀ
  • 8,218
  • 8
  • 36
  • 58
  • What is a "google drive picker"? – Alexander Apr 28 '16 at 16:39
  • Can you make a [sencha fiddle](http://fiddle.sencha.com) that exhibits your problem? – Alexander Apr 28 '16 at 16:40
  • Any js errors in a console? – serg Apr 28 '16 at 17:07
  • Serg - there don't appear to be any JS errors in the console related to the combobox... There are some related to the Google Drive Picker which appear (see [this](http://stackoverflow.com/questions/29658088/google-api-error-but-still-works) (which I know links to more SO questions :| ) – Sᴀᴍ Onᴇᴌᴀ Apr 28 '16 at 17:13
  • @Aelliott1485 Js errors is what's causing this most likely, need to fix those first. – serg Apr 28 '16 at 17:28
  • Well, as [Quentin said](http://stackoverflow.com/questions/16145475/invalid-x-frame-options-header-encountered-when-loading#answer-16145732): "`You don't control Google's HTTP headers, so you can't (short of getting a job where you do control them) make them use valid options.`" – Sᴀᴍ Onᴇᴌᴀ Apr 28 '16 at 19:14
  • I tried making a Sencha fiddle but it won't let me add the google js file with its callback (``) I see in the browser console: `The XSS Auditor refused to execute a script in 'https://fiddle.sencha.com/run?_dc=1461868927080' because its source code was found within the request. The auditor was enabled as the server sent neither an 'X-XSS-Protection' nor 'Content-Security-Policy' header.` :/ – Sᴀᴍ Onᴇᴌᴀ Apr 28 '16 at 19:22

1 Answers1

2

I ran into the same problem with ExtJS 3.3.

It is because gdrive js client adds a function to the array prototype called values. Subtemplate of combo's XTemplate has a target "callback" like this:

(function(values,parent
/**/) {
with(values){ return values; }
})

This "callback" is generated by Ext.XTemplate function. I modified that to generate "callback" like this:

(function(values,parent
/**/) {
if(typeof values.values != "function"){with(values){ return values; }} else {return values;}
})

Regards,
Gyula

Gyula
  • 36
  • 1
  • Great - thanks! I found the place in the 4.0.5 source to modify - it is slightly different but not overly convoluted. Now I just have to get it into the compiled version :) – Sᴀᴍ Onᴇᴌᴀ May 02 '16 at 18:32