kartik-v / yii2-widgets

Collection of useful widgets for Yii Framework 2.0
http://demos.krajee.com/widgets
Other
558 stars 175 forks source link

Demo code for typeahead is in incorrect style/syntax. #375

Open bscheshirwork opened 5 years ago

bscheshirwork commented 5 years ago

Prerequisites

Steps to reproduce the issue

  1. http://demos.krajee.com/widget-details/typeahead#settings
  2. Scroll to pluginEvents

Expected behavior and actual behavior

When I follow those steps, I see...

pluginEvents = [
    "typeahead:active" => "function() { log("typeahead:active"); }",
    "typeahead:idle" => "function() { log("typeahead:idle"); }",
    "typeahead:open" => "function() { log("typeahead:open"); }",
    "typeahead:close" => "function() { log("typeahead:close"); }",
    "typeahead:change" => "function() { log("typeahead:change"); }",
    "typeahead:render" => "function() { log("typeahead:render"); }",
    "typeahead:select" => "function() { log("typeahead:select"); }",
    "typeahead:autocomplete" => "function() { log("typeahead:autocomplete"); }",
    "typeahead:cursorchange" => "function() { log("typeahead:cursorchange"); }",
    "typeahead:asyncrequest" => "function() { log("typeahead:asyncrequest"); }",
    "typeahead:asynccancel" => "function() { log("typeahead:asynccancel"); }",
    "typeahead:asyncreceive" => "function() { log("typeahead:asyncreceive"); }",
];

I was expecting...

                        'pluginEvents' => [
                            "typeahead:active" => "function() { console.log(\"typeahead:active\"); }",
                            "typeahead:idle" => "function() { console.log(\"typeahead:idle\"); }",
                            "typeahead:open" => "function() { console.log(\"typeahead:open\"); }",
                            "typeahead:close" => "function() { console.log(\"typeahead:close\"); }",
                            "typeahead:change" => "function(e, suggestion) { console.log(\"typeahead:change\", e, suggestion); }",
                            "typeahead:render" => "function() { console.log(\"typeahead:render\"); }",
                            "typeahead:select" => "function() { console.log(\"typeahead:select\"); }",
                            "typeahead:autocomplete" => "function() { console.log(\"typeahead:autocomplete\"); }",
                            "typeahead:cursorchange" => "function() { console.log(\"typeahead:cursorchange\"); }",
                            "typeahead:asyncrequest" => "function() { console.log(\"typeahead:asyncrequest\"); }",
                            "typeahead:asynccancel" => "function() { console.log(\"typeahead:asynccancel\"); }",
                            "typeahead:asyncreceive" => "function() { console.log(\"typeahead:asyncreceive\"); }",
                        ],

also include to example a function arguments is better

Environment

Browsers

Operating System

Libraries

Isolating the problem

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/69385150-demo-code-for-typeahead-is-in-incorrect-style-syntax?utm_campaign=plugin&utm_content=tracker%2F530581&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F530581&utm_medium=issues&utm_source=github).
bscheshirwork commented 5 years ago

Same situation on another pages http://demos.krajee.com/checkbox-x