【发布时间】:2017-02-11 14:15:49
【问题描述】:
假设我在内容页面 /content/phonegap/ss/en_gb/login/home/test1/jcr:content/par/productimage 上有一个带有对话框拖放到 parsys 的组件
我希望将$PATH 附加到 URL 并将所选设备(例如文本 'Device ID:HTC_10_GOLD')发送到此对话框侦听器 extjs 中的 servlet:
<deviceAndColour
jcr:primaryType="cq:Widget"
allowBlank="{Boolean}false"
fieldLabel="Device and Colour"
name="./deviceAndColour"
options="/bin/reference/data/device.devices.json$PATH"
type="select"
xtype="selection">
<listeners
jcr:primaryType="nt:unstructured"
selectionchanged="function(pathfield) {
var selected = this.findParentByType('form').find('name', './deviceAndColour')[0].getText();
console.log( this.findParentByType('form').find('name', './deviceAndColour')[0].getText());
$.getJSON('/bin/reference/data/device/availablecolour.availablecolour.json$PATH?selectedDevice=' + selected + '&colour=red', function(jsonData){
selectBox.setOptions(jsonData);
});
}" />
</deviceAndColour>
所以基本上,console.log( this.findParentByType('form').find('name', './deviceAndColour')[0].getText()); 没有按我的预期工作,对话侦听器 js 中的$PATH 也没有,它根本不检索路径。
除了上面的尝试,我知道var selected = this.findParentByType('form').find('name', './deviceAndColour')[0].getValue();这将正确地获得与选择相关的值,但我不需要值,我只想getText(),并在extjs中获得当前的$PATH。
其他问题,你可能注意到$.getJSON('/bin/reference/data/device/availablecolour.availablecolour.json$PATH?selectedDevice=' + selected + '&colour=red'
我如何跳过这个listner中的&,就好像我直接使用&,项目甚至不会构建。一定有办法跳过 & 让 extjs 当作字符串的一部分来发送请求
以前有人经历过吗?请提供代码示例。
谢谢
【问题讨论】:
标签: extjs dialog selection aem