This is a migrated thread and some comments may be shown as answers.

Dropdown not showing when clicked.

1 Answer 127 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 17 Jun 2012, 01:53 PM
Hello, Its been week and still no luck on dropdown and finally I'm throwing up my towel. I hope you can help me on this.


          
         var lastNameData =[{"lastName":"White","lastNameID":0},{"lastName":"Great","lastNameID":1}];
          
               var lastNameDataSource = new kendo.data.DataSource({
        data: lastNameData,
            schema: {
            model: {
                id: "lastNameID"
            }
        }
    });
             
             
             
          
          
         function lastNameDropDownEditor(container, options) {
                         
                  $('<input data-bind="value:' + options.field + '"/>')
    .appendTo(container)
    .kendoComboBox({
         autoBind: false,
        dataTextField: "lastName",
        dataValueField: "lastName",
        dataSource: lastNameDataSource
    });
                }
          
var blankData;
                $(document).ready(function () {
                    var dataSource = new kendo.data.DataSource({
                         
                                parameterMap: function(options, operation) {
         
        //alert(operation);
                                    if (operation !== "read" && options.models) {
                                        return {models: kendo.stringify(options.models)};
                                    }
                                   
                                    },
                 
                transport: {
                     
         read: {
dataType: "json",
 type: "POST",
data: {"SQLCMD":"SELECT * FROM gridTest","Table":["firstName","nickName","lastName"],"PrimaryKey":"peopleID"}
},
         update: {
            type: "POST"
         },
         destroy: {
             type: "POST"
          },
          create: {
              type: "POST",
               data: {
                req: ["firstName","nickName"]                }
               
               
           }
         },
                
         // determines if changes will be send to the server individually or as batch
         batch: false,
         //...
 
 
                       pageSize: 30,
                       data: blankData,
                       autoSync: true,
                       schema: {
                           model: {
                             id: "peopleID",
                             fields:
                                {"peopleID":{"editable":false,"nullable":true},"firstName":{"type":"string","validation":{"required":true},"nullable":false,"defaultValue":""},"nickName":{"type":"string","validation":{"required":true},"nullable":false,"defaultValue":""},"lastName":"lastName"}                             }
                           ,  parse: function (data) {
        // alert(data);
            return data;
        }
                       }
                    });
 
                    $("#grid").kendoGrid({
                        dataSource: dataSource,
                        pageable: true,
                        height: 340,
                        toolbar: ["create"],
                        columns:
                            [{"field":"firstName","title":"First name"},{"field":"nickName","title":"Nick Name"},{"field":"lastName","width":"150px","editor":"lastNameDropDownEditor"},{"command":"destroy","title":" ","width":"110px"}]                            ,
                             
                        editable: true
                    });
                });


Please help! thanks!

1 Answer, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 17 Jun 2012, 05:38 PM
[Marked as solved]: Disregard this. It's because of the incompatibility through dynamic generation of PHP in json_encode. 


the error (which I struggled for days) is because the "editor":"lastNameDropDownEditor" has quotation on it.
Tags
Grid
Asked by
Mike
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
Share this question
or