PDA

View Full Version : Linking code and syntax into documentation?



oldroy
14 Dec 2007, 11:21 AM
Would there be any formal or informal attempt to link syntax and code into the documentation? I find myself searching forums endlessly for hours for small bits of essential syntax in using the ext objects methods and properties. And while I don't mind looking for and learning things about ext on my own, I've found that hours looking at forums to find something that could be linked into the object and method definitions is not my definition of productivity.

I also see the redundant postings of newer users that could be cut in half if there was a syntax primer and code examples linked in. I know 2.0 is just finished, and I know that you can't put together code examples for a library that was still not complete until a couple of weeks ago, but there has got to be a better way to learn how to use extjs than currently exists.
My perfect example? 2.0 Element.replace....no code anywhere and no way of figuring out how to use this method from the documents. And since this is the fourth or fifth time I've spent a couple hours chasing down something really simple, I thought this needed to be pointed out.

As a newer user I am hesitant to post any questions for fear of angering the wizards who will tell me about the 2000 other stupid posts on the same topic. Yet if you follow the 2000 other stupid posts, the questions always seem only to be only slightly related, not answers to specific problems. This is where syntax, and code in the documents should come in. Extjs should take over the planet, but only if there is a more gentle way and clearer path of learning to use it.
So how about it? How about either links in the documents where we can link directly to code, or actually putting code in the documents? And lacking that how about a syntax primer?

Now don't anybody jump down my throat. Extjs is a super-duper thing. Thanks alot for building it and sharing it. But could we make it even better and attract an even bigger and more creative community with better code exmaples?

tryanDLS
14 Dec 2007, 12:14 PM
There are a number of threads discussing documentation - please see those rather than starting a new thread. There may be others, but here are a few

http://extjs.com/forum/showthread.php?t=19564
http://extjs.com/forum/showthread.php?t=15314

JeffHowden
14 Dec 2007, 6:27 PM
[...]My perfect example? 2.0 Element.replace....no code anywhere and no way of figuring out how to use this method from the documents. [...]

From the docs:

http://extjs.com/deploy/dev/docs/?class=Ext.Element&member=replace


replace( Mixed el ) : Ext.Element
Replaces the passed element with this element

Parameters:
* el : Mixed
The element to replace
Returns:
* Ext.Element
this

So, assuming "myEl" and "myOtherEl" are references to Ext elements, this would work:


myNewEl = myEl.replace(myOtherEl);

In this example, myOtherEl is replaced with myEl and myNewEl is a reference to myEl.