How can I get a $(document).ready template?
If I dont put the inital $ in the template, then it seems to work, but the generated code comes out formated a little gimpily...I think becasue it wants to line up the braces with the word "function"
This is what generates:
(document).ready(function() |
{ |
//Code |
}); |
This is what I'm looking for
(document).ready(function(){ |
//Code |
}); |
(obviously with the $ identifier at the start as well...)
21 Answers, 1 is accepted
Thanks for contacting us.
There are two problems with your template. First we do not support $ in the templates. We use it as a special character indicating place holder.
The second issue is with our JavaScript formatter. Currently we do not support
(document).ready(
function
(){
//Code
});
I have created a tasks in our Public Issue Tracking System and I have added some Telerik points to your account to compensate for your efforts.
Jordan
the Telerik team
Unfortunately you can't do that with the current version and the new version, we will release this week. I have increased the priority of the task and have moved the bug for the service pack.
Regards,Jordan
the Telerik team
It doesn't come with any template samples for me to look at...
Yes you could escape the $ in templates now using the '\' character. Have a look at http://blogs.telerik.com/justcodeteam/posts/10-09-06/justcode_code_templates.aspx for a complete description of the template syntax now.
What do you mean by saying the latest internal build does nto come with any template samples? There area bunch of default templates now for every supported language including Javascript. Don't you see these?
Tsviatko Yovtchev
the Telerik team
So I guess you have embedded templates we can't change?
Anyway...Im not really able to Add new templates. Click Add, type in the template, give it an Acro, and hit save...nothing shows in the box.
Could you, please, send over your AppData\Roaming\JustCode\userConfiguration.xml file? You may want to start a new ticket for that. Also, it'd be nice to have a look at the content of your AppData\Local\JustCode\Logs folder.
Kind regards,
Tsviatko Yovtchev
the Telerik team
What happens is that our version of Telerik Controls collides with theirs. Consequently soem of them won't get displayed. That's how the grid that holds the templates does not get displayed at all. When you install the official release that comes out this week that problem will be gone since the versions will be in sync. And we are gonna fix the issue as a whole in teh service pack to come.
Otherwise the templates should be working for you even now. Please, try typing "f" and then shift + space. That should expand the for template for one thing.
Yeah I have WebUI installed, and f Shift-Space worked fine.
I really need to at least see what's available to me as far as templates go in that grid. What would be even slicker is some way to see the templates in the code window as well.. Like if I make some templates but I don't use them often I might forget the shortcut to get them, maybe something like Shift-space on a new line with no text on it opens a list of templates, select enter activates it (or something like that)
I remember templates in the "other companies product" having that issue too...I had so many templates but could never remember what I set as the activation.
1) Doesn't show the Acronym to activate (that I can see), so Alt-End defeats the ease-of-use of the shortcuts
2) It shows the Code which will be inserted instead of an Alias which is way easier for a list ("RadGrid ItemDataBound" for example)
$(document).ready(
function
()
{
});
Could you send over the definition of that template so that I can see what goes wrong with it? That looks like something we'd like to fix :)
Sincerely yours,Tsviatko Yovtchev
the Telerik team
\$(document).ready(
function
(){
});
Here's the thing, I don't WANT to keep turning all these functions off...I do like a lot of what JustCode is helping me do, but it seems that the answer for all the little quirks in one area, is to turn something else...off
Sorry for the late response. It appears that we have some gaps in the way we format JavaScript. modifying JustCode's formatting settings is won't be enough to get the format that you are trying to achieve for this template. The best you can get is by turning off two options -
1. JustCode | Options | Code Style | JavaScript | New Lines -> Place open brace on new line for functions.
2. JustCode | Options | Code Style | JavaScript | Indentation -> Align multiline call arguments.
That's as much as you can get without disabling JustCode's JavaScript formatting. After switching those off you will have the last line indented and not aligned to the beginning. This was intentionally done as it brings more readability to your code. However we will be enhancing greatly our formatting for our next release so this will be improved with additional options.
Greetings,
Deyan
the Telerik team
I really don't want to keep turning features off because they are useful in other places :/
I'm sure corp wants you to keep adding new big things for each Q release...but there's a lot of room to improve the existing things...like templates...or intelligence behind the closing quotes\braces...
Although...I must say I'm super glad to have the structure highlighting...very nice job guys (I missed having that)
Thanks for the nice words. Client feedback is the most important factor that affects our planning and development efforts. We implemented structural highlighting as a result of client requests. We try to listen and please as much as possible our clients so you can be sure that there will be great improvements in this area for the next Q release. In fact formatting will be one of the main areas where JustCode will change in the near future.
Greetings,
Deyan
the Telerik team