Display DatePicker On Razor Syntax MVC3

  1. #1

    Display DatePicker On Razor Syntax MVC3

    Hi,
    I have a problem, iwant using datepicker on selected option.
    but I can not display datepicker calendar.
    Click image for larger version. 

Name:	Untitled.jpg 
Views:	31 
Size:	88.3 KB 
ID:	5944
    this my code
    @Html.X().ResourceManager().Theme(Theme.Gray)
    @(Html.X().Window().Width(400).Height(200).BodyPadding(5).Resizable(true)
          .TopBar(
              Html.X().Toolbar().EnableOverflow(true).Items(
                      /*Nested Menu menggunakan objek check*/
                      Html.X().Button().Text("More options").Menu(
                          Html.X().Menu()
                              .Items(
                                  Html.X().MenuItem().Text("Theme").Icon(Icon.Theme).Menu(
                                      Html.X().Menu().Items(
                                          Html.X().CheckMenuItem().Text("Black").Group("Theme").CheckHandler("MyApp.onItemCheck")
                                          ).Items(
                                              Html.X().CheckMenuItem().Text("Gray").Group("Theme").CheckHandler("MyApp.onItemCheck")
                                          ).Items(
                                              Html.X().CheckMenuItem().Text("Blue").Group("Theme").CheckHandler("MyApp.onItemCheck")
                                          )
                                      )
                              ).Items(
                                  Html.X().MenuItem().Text("Choose a Date").Icon(Icon.Calendar).Menu(
                                      Html.X().Menu().Items(
                                          Html.X().DateMenu().Picker(picker =>
                                                                         {
                                                                             picker.Listeners.Select.Handler = "alert(Ext.String.format('You chose {0}.',Ext.util.Format.date('2012-09-14', 'M j, Y')));";
                                                                         })
                                          )
                                      )
                              ).Items(
                                  Html.X().MenuSeparator()
                              ).Items(
                                  Html.X().MenuItem().Text("Choose a Color").Icon(Icon.Color).Menu(
                                      Html.X().Menu().Items(
                                          Html.X().ColorMenu().Listeners(ev=>ev.Select.Handler="alert(Ext.String.format('You chose {0}.',color));"))
                                      )
                              )
                          )
                  )
          ))

    how to display datepicker? whats wrong with my code,
    and I can not find any reference of http://mvc.ext.net/
    reference from http://docs.sencha.com/ext-js/4-1/#!...-selectHowever

    thanks,
    4L4Y
    Last edited by 4L4Y; Apr 02, 2013 at 3:32 AM.
  2. #2
    Hi @4L4Y,

    The MenuItem should look like this.

    Example
    Html.X().MenuItem()
        .Text("Choose a Date")
        .Icon(Icon.Calendar).Menu(
            Html.X().DateMenu().Picker(picker =>
                picker.Listeners.Select.Handler = "alert(Ext.String.format('You chose {0}.',Ext.util.Format.date('2012-09-14', 'M j, Y')));"
            )
    )
  3. #3
    hi daniil

    thanks, thats my fools, I enter into Items.
    sorry about my stupid question.

    Regrads,
    4L4Y

Similar Threads

  1. [CLOSED] autocomplete example with razor syntax ?
    By zwf in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Oct 19, 2012, 3:56 PM
  2. MVC3 Razor: Desktop button is not working
    By nahuel2203 in forum 2.x Help
    Replies: 0
    Last Post: Jun 24, 2012, 3:02 AM
  3. Ajax Problem - MVC3 RAZOR
    By chrono in forum 2.x Help
    Replies: 2
    Last Post: Jun 04, 2012, 10:49 PM
  4. [CLOSED] CalendarPanel Razor MVC3
    By T3rryChan in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: May 02, 2012, 11:43 AM
  5. Ext.Net with MVC3(Razor)
    By abanikumar in forum 1.x Help
    Replies: 4
    Last Post: Jan 16, 2012, 9:55 AM

Posting Permissions