Пример #1
0
        static void OnReady()
        {
            var data = new[] {
                        "Red-violet",
                        "Red",
                        "Red-orange",
                        "Orange",
                        "Yellow-orange",
                        "Yellow",
                        "Yellow-green",
                        "Green",
                        "Blue-green",
                        "Blue",
                        "Blue-violet",
                        "Violet"
            };

            new jQuery("#products").kendoAutoComplete(data.As<AutoCompleteConfiguration>());

            autoComplete = new jQuery("#products").data("kendoAutoComplete").As<AutoComplete>();
            JsAction<Event> setValue = SetValue;
            JsAction<Event> setSearch = SetSearch;

            new jQuery("#set").click(setValue);
            new jQuery("#value").keypress(setValue);
            new jQuery("#search").click(setSearch);
            new jQuery("#word").keypress(setSearch);

            //new jQuery("#get").click(() => HtmlContext.window.alert(autoComplete.value()));


        }
Пример #2
0
        static void OnReady()
        {
            var data = new[] {
                    "12 Angry Men",
                    "Il buono, il brutto, il cattivo.",
                    "Inception",
                    "One Flew Over the Cuckoo's Nest",
                    "Pulp Fiction",
                    "Schindler's List",
                    "The Dark Knight",
                    "The Godfather",
                    "The Godfather: Part II",
                    "The Shawshank Redemption"
                    };

            new jQuery("#search").kendoAutoComplete(new AutoCompleteConfiguration
            {
                dataSourceObject = data,
                separator = ", "
            });

            var validator = new jQuery("#tickets").kendoValidator().data("kendoValidator").As<Validator>();
            var status = new jQuery(".status");

            new jQuery("button").click(() =>
            {
                if (validator.validate())
                {
                    status.text("Hooray! Your tickets has been booked!").addClass("valid");
                }
                else
                {
                    status.text("Oops! There is invalid data in the form.").addClass("invalid");
                }
            });
        }
Пример #3
0
 static Native_JavaScript_Classes()
 {
     var SharpKitSamples = new { };
     
 }
Пример #4
0
 static TypeCastingSample()
 {
     var SharpKitSamples = new { };
 }
Пример #5
0
 static NamespaceSample_Global()
 {
     //Declare the namespace objects
     var NamespaceSample = new { Namespace1 = new { }, Namespace2 = new { } };
 }
Пример #6
0
    static InlineJSCodeSample()
    {
        var SharpKitSamples = new { };

    }
Пример #7
0
 static void OnReady()
 {
     var data = new[] {
                     "Alabama",
                     "Alaska",
                     "American Samoa",
                     "Arizona",
                     "Arkansas",
                     "California",
                     "Colorado",
                     "Connecticut",
                     "Delaware",
                     "District of Columbia",
                     "Florida",
                     "Georgia",
                     "Guam",
                     "Hawaii",
                     "Idaho",
                     "Illinois",
                     "Indiana",
                     "Iowa",
                     "Kansas",
                     "Kentucky",
                     "Louisiana",
                     "Maine",
                     "Maryland",
                     "Massachusetts",
                     "Michigan",
                     "Minnesota",
                     "Mississippi",
                     "Missouri",
                     "Montana",
                     "Nebraska",
                     "Nevada",
                     "New Hampshire",
                     "New Jersey",
                     "New Mexico",
                     "New York",
                     "North Carolina",
                     "North Dakota",
                     "Northern Marianas Islands",
                     "Ohio",
                     "Oklahoma",
                     "Oregon",
                     "Pennsylvania",
                     "Puerto Rico",
                     "Rhode Island",
                     "South Carolina",
                     "South Dakota",
                     "Tennessee",
                     "Texas",
                     "Utah",
                     "Vermont",
                     "Virginia",
                     "Virgin Islands",
                     "Washington",
                     "West Virginia",
                     "Wisconsin",
                     "Wyoming"
             };
     new jQuery("#products").kendoAutoComplete(new AutoCompleteConfiguration
     {
         dataSourceObject = data,
         select = e => onSelect(e),
         change = onChange,
         close = onClose,
         open = onOpen
     });
 }