- 浏览: 2115172 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
sunzeshan:
找了很久,用了这个插件解决问题啦。谢谢
eclipse jetty debug source not found -
xiaosong0112:
您好,请问为什么要这样设置呢,原理是什么?在网上很多转帖都没有 ...
maven的jetty插件提示No Transaction manager found导致启动慢的解决方法 -
eimhee:
tjzx 写道畅搜谷歌:http://dian168.cc/打 ...
Google 镜像站搜集 -
tjzx:
畅搜谷歌:http://dian168.cc/打开的是“最火源 ...
Google 镜像站搜集 -
eimhee:
finallygo 写道你这属于"头痛医头脚痛医脚& ...
解决linux下too many file问题
I was having issues with passing the element directly to the constructor of basic dialog, but everything worked when I gave the element an id and passed the string of the id to the constructor. I have a screenshot of what happens when I pass the element directly.
var listElement = document.createElement('ul'); var responseFunction = function responseFunction(response){ XMLResponse = response.responseXML var titles = XMLResponse.getElementsByTagName("title"); for (var i = 0; i < titles.length; i++){ var listId = XMLResponse.getElementsByTagName("listid")[i].childNodes[0].nodeValue; var title = XMLResponse.getElementsByTagName("title")[i].childNodes[0].nodeValue; var opt = document.createElement('li'); listElement.appendChild(opt); opt.setAttribute('listId',listId); opt.appendChild(document.createTextNode(title)); opt.onclick = function () { var flashMovie = getFlashMovieObject("mp3player"); addSong(this.getAttribute('listId'),flashMovie.GetVariable("/:trackId")); }; } var divElement = document.createElement('div'); divElement.setAttribute("class","dialogContent"); divElement.setAttribute("id","playlistDialog"); var titleElement = document.createElement('div'); titleElement.setAttribute("class","x-dlg-hd"); titleElement.appendChild(document.createTextNode('Add to a Playlist')); divElement.appendChild(titleElement); var contentElement = document.createElement('div'); contentElement.setAttribute("class","x-dlg-bd"); contentElement.appendChild(listElement); divElement.appendChild(contentElement); document.body.appendChild(divElement); dialog = new Ext.BasicDialog(listElement, { modal:true, draggable: false, resizable: false, width:500, height:300, minWidth:300, minHeight:300 }); dialog.addButton('Submit', dialog.hide, dialog).disable(); dialog.addButton('Close', dialog.hide, dialog); dialog.show(parentNode);
#2
03-05-2007, 12:39 PM
|
|
#3
03-05-2007, 12:55 PM
|
Not sure why you'd want to do all that work yourself - you can use autoCreate:true to tell the Dialog to create all the HTML for you. Also why are you rendering the dialog to a UL element?
You might try using Firebug to compare the generated HTML of your approach vs what happens when you use autoCreate, or what's built when you just point it to a div and let it build all the child elements.
__________________
Tim Ryan - Ext JS Support Team Read BEFORE posting a question / posting a Bug Use Google to Search - API / Forum API Doc (3.x | 2.x | 1.x) / FAQ / Wiki / Tutorials / 1.x->2.0 Migration Guide |
#4
03-05-2007, 01:04 PM
|
I'm new to Ext. Can you explain? Basically, I'm just creating an unordered list based on the data and making that the content of the dialog. It should actually be divElement because I tried placing it within a div to see if that made a difference but it didn't. I've switched over to JSON, so that bit actually look like this:
var playlists = eval(response.responseText); for (var i = 0; i < playlists.length; i++){ var listId = playlists[i]['listid']; var title = playlists[i]['title']; var opt = document.createElement('li'); listElement.appendChild(opt); opt.setAttribute('listId',listId); opt.appendChild(document.createTextNode(title)); opt.onclick = function () { addSong(this.getAttribute('listId'),currentSong['trackid']); dialog.hide(); }; } |
#5
03-05-2007, 02:31 PM
|
This is one of the common uses for the Template functionality. Take a look at this blog post - it actually has examples that build lists like you're doing - note that it still uses the .33 syntax, so you'll have to replace things like YAHOO.ext with Ext. http://www.jackslocum.com/blog/2006/...-or-templates/
I would also recommend looking thru downloaded examples - you'll find more uses of templates and also wiring a single click handler, rather than one for each 'LI'. Once you have it working in a div, it should be simple to append it to a Dialog instead - note that you append to the dialog.body, not the dialog.
__________________
Tim Ryan - Ext JS Support Team Read BEFORE posting a question / posting a Bug Use Google to Search - API / Forum API Doc (3.x | 2.x | 1.x) / FAQ / Wiki / Tutorials / 1.x->2.0 Migration Guide |
发表评论
-
jquery dual list 插件
2010-12-21 17:24 2355In my work, I came across the n ... -
Start PageIndexHistoryLast Change
2010-12-15 00:22 1010The specifications should provi ... -
ajax upload
2010-11-19 13:22 0ajax upload The following cri ... -
兼容IE和FF获取Referer的JS方法
2010-11-11 10:11 4472众所周知,我们web开发人员痛恨IE浏览器,因为IE不支持标准 ... -
jQuery优化
2010-09-16 08:30 5484之前,我们减少字节数和请求次数以及加载顺序以使页面加载的更快。 ... -
jQuery add table row
2010-08-23 13:39 0The approach you suggest is not ... -
Add and Remove items with jQuery
2010-08-23 13:25 0Add and Remove items with jQuer ... -
extjs和struts、json的整合
2009-08-13 09:52 4504使用extjs配合struts的MVC架构是目前流行的做法,两 ... -
extra 1px space in dialog handle style - Ext JS
2009-04-20 23:33 1564Im developing a new style and h ... -
Grid - Custom header renderer? - Ext JS
2009-04-20 23:33 2060Is it possible to create a cust ... -
Inputs to DatePicker - Ext JS
2009-04-20 23:33 2149I thought I had read that you c ... -
dateFormat with timezone - Ext JS
2009-04-20 23:33 3581If I create JSON data on server ... -
How to use Ext.each? - Ext JS
2009-04-20 23:33 4470I'm trying to use Ext.each. It ... -
afteredit event ... new value? - Ext JS
2009-04-20 23:33 1503the new value is not set before ... -
problem qith iframe's - Ext JS
2009-04-20 23:33 1126I want to have dialogs and wher ... -
[Grid] Ext.data documenation - Ext JS
2009-04-20 23:33 1459I'm porting my grids to use the ... -
Last column to auto-adjust - Ext JS
2009-04-20 23:33 2689I can't see that this is curren ... -
Tree non-async creation "bug" - Ext JS
2009-04-20 23:32 2387When building a tree without us ... -
Bug - reload method of AsyncTreeNode - Ext JS
2009-04-20 23:32 1999Happens when the tree config o ... -
Minor grid paging toolbar issues - Ext JS
2009-04-20 23:32 1510When a grid toolbar is displaye ...
相关推荐
A meaningful modification for the Tang-Toennies potential model: Application to He-He potential,盛晓伟,P.Li,the repulsive wall of the Tang-Toennies model is, unfortunately, generally too stiff....
Ext GWT 2.0: Beginner's Guide is a practical book that teaches you how to use the Ext GWT library to its full potential. It provides a thorough, no-nonsense explanation of the Ext GWT library, what ...
VDA_6.3_Potential_Analysis__Rev._2016_V4.xlsmVDA_6.3_Potential_Analysis__Rev._2016_V4.xlsm
Learning-BeagleBone-Python-Programming-Unleash-the-potential-of-BeagleBone-using-Python.pdf
artificial-potential-field-matlab-master.zip
非常好的学习cr的资料,The Throughput Potential of Cognitive Radio -- A Theoretical Perspective
安装要以编程方式使用is-potential-custom-element-name ,请通过将其安装为依赖项: $ npm install is-potential-custom-element-name 然后, require它: const isPotentialCustomElementName = require ( 'is-...
RRT-star-artificial-potential-field-master.rar
COGNITIVE RADIOS FOR DYNAMIC SPECTRUM ACCESS - The Throughput Potential of Cognitive Radio -- A Theoretical Perspective
前端开源库-is-potential-custom-element-name是潜在的自定义元素名称,请检查给定的字符串是否与
to a potential processor designer, nor should they be as simple as the answers given to a layman. The pedagogical question that drives the content of this book is, \What is the simplest explanation of...
IMMUNOPROTECTION AND DIAGNOSTIC POTENTIAL OF SIGNALING PROTEIN 14-3-3 OF SCHISTOSOMA JAPONICUM×,刘庆中,沈继龙,The 14-3-3 protein is a key player in signal transduction processes in various species...
2023年6月新书,适合中高级技术人员参考学习使用。主要内容: Chapter 1. GPT-4 and ChatGPT Essent?als ... Advanced Techniques to Unlock the Full Potential of GPT-4 and ChatGPT …… …………
人工势场算法 ,matlab 仿真程序。。。。
Extending the Return Potential Model With a Descriptive Normative Belief Measure
Walk through potential challenges in building complex transfer learning models from scratch Explore real-world research problems related to computer vision and audio analysis Understand how ...
A technical interview is a rare opportunity to show potential employers what you're worth. You owe it to yourself to read this guide and make the most of it! Table of Contents Introduction? The Java ...
An Introduction to the Event-Related Potential Technique.PDF 是一个STEVEN J。LUCK的经典ERP实验指导书,2009年由范思陆翻译成中文,华东师范大学出版《事件相关电位基础》
潜在冲突检查器动作 创建或更新请求请求时,此操作将比较所有其他请求请求,然后在更改相同文件的情况下在请求请求上留下注释,并且在其他合并请求首先合并时,可能会... with: ghToken: ${{ secrets.GITHUB_TOKEN }}
The size prediction of potential inclusions embedded in the sub-surface of fused silica by damage morphology