I'm using dhtmlxGantt but my project is VERY long and I only would only like to display the months without the days and also display the years...How could I do that?
Thanks!!
Nevermind got it...
gantt.config.scale_unit = "month";
gantt.config.date_scale = "%Y-%M";
Related
I'm using Carousel View by alexrainman for creating custom wizard.
I need to get index of specific page by its type (I don't know exactly which index would that page have).
Something like this:
var indexAdvanced = MyCarouselView.GetIndex<ContentView>(typeof(AdditionalDefectParametersContentView));
but of course, this code doesn't work. While creating this question, I've got an idea with using CarouselView's ItemsSource. How to do it properly? TIA.
By the way, I've already found an answer. >_<
The resulting code is:
// My CarouselView consists of ContentViews
_indexAdvanced = MyCarouselView.ItemsSource.Cast<ContentView>().
IndexOf(view => view is AdditionalDefectParametersContentView);
So it works!
Don't know what should I do: delete this question or leave? Maybe It would be useful for somebody, so I'll leave it for now.
I'm having an issue i've seen others post about, using the Enter key is causing an extra line break to appear. Now I know I can use shift + enter, but i can't except my users to know that.
Is there a fix for this? I've using v0.8.8, I saw this:
https://github.com/summernote/summernote/issues/546#issuecomment-341518461
but this did not work, i saw another post using $.summernote.addPlugin({
but .addPlugin does not work in v0.8.8 anymore.
Was anyone able to get around this?
The answer to this question is at this link by summernote breakline paragraph to br
all credit to Ghylt
You can use the following code to change the functionality of Enter
$('#summernote').summernote().on("summernote.enter", function(we, e) {
$(this).summernote('pasteHTML', '<br> ');
e.preventDefault();
});
It's works for me.
Ref:- Github
A few days ago I asked a question about Drupal 8 YAML Form Module: Populate Select Element. I found a solution that it works fine for me.
But now I've got a new doubt. I would like to change the value of a Hidden element and depending of this value, to show some elements in the form or not. I'm trying to implement the hook hook_yamlform_element_info_alter(array &$elements) and I do $elements['hidden_element_name']['#value'] = 'New value of the hidden element' but it doesn't work.
Any ideas? Thanks in advance!
Here is the solution: How do I change the value of a Hidden element?
Basically, I've implemented hook_form_FORM_ID_alter() and I do:
$form['elements']['hidden_element_name']['#value'] = 'New value of the hidden element';
I hope it helps someone!
I want to use the method loadXMLString() to refresh the content of my grid.
I founded this, but this is not working for me :
http://forum.dhtmlx.com/viewtopic.php?f=14&t=11382
So I tried this :
grid._refreshFromXML =[true,true,false];
grid.loadXMLString(".....");
Again, not working !
Any ideas ?
I suppose the problem is with the line "grid._refreshFromXML = ..."
Thanks a lot !
I'm working with DHTMLX 3.6.
Please try to use
grid._refresh_mode =[true,true,false];
There is no _refreshFromXML function in the grid.
I am trying to setup my model so I can use the
#Html.EditorFor(e => e.publicationTitle) and have it show a Watermark with a hint.
Currently I am doing
#Html.LabelFor(e => e.PublicationTitle) #Html.TextBox("PublicationTitle",tempTitle.ToString(), new { style = "width:350px", placeholder = "Put title here" })
#Html.ValidationMessageFor(e => e.PublicationTitle)
I have found that you can put a [Display(Prompt="Enter title here")] in my model
but it is not showing up in my view for some reason.
On a side note. I did try to follow the instructions from this post
Html5 Placeholders with .NET MVC 3 Razor EditorFor extension?
At the end of this post it says to change the ~/Views/Shared/EditorTemplates/String.cshtml file but this file is not located in my project.
Any hints would be appreciated. Thank you in advance.
FOLLOW UP!
Ah the joys of MVC3. Apparently the above post answers the question once you understand what is going on. If you create the EditorTemplates/String.cshtml file in your ~/Views/Shared/ folder then it will use this template for your editfor boxes.
Final Answer to be concise for others looking will be posted below.
In your controller you need to do the following
[Display(Prompt="First Name Goes Here",Name="First Name")]
[StringLength(100,ErrorMessage="First Name may not be longer than 100 characters")]
public string AuthFirstName { get; set; }
The Prompt="This is what will display" under display is the watermark that will be created.
Then you will need to create the folder "EditorTemplates" under ~/Views/Shared the entire path will be ~/Views/Shared/EditorTemplates/
Then create the file String.cshtml and place the following code in it
#Html.TextBox("",ViewData.TemplateInfo.FormattedModelValue, new { #class="text-box single-line", placeholder = ViewData.ModelMetadata.Watermark })
More detailed information can be found at the link posted by tugberk (SO question and SO answer).
This will not work with IE unfortunately. At least IE9 and earlier. I spent couple hours pulling my hair as to why this helped others and doesn't work here. Apparently IE won't show prompts. Hope IE10 will address the issue.
The placeholder attribute is not supported in earlier versions of IE, so for the Display[(Promt="...")] to work fine I recommend to use (along with the String template as Samack described) any jQuery watermark plugin (I used the google one) then add this to the Document.Ready function:
$(document).ready(function(){
$(':text').watermark({ textAttr: 'placeholder' });
})