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

Form elements

6 Answers 1984 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jacob
Top achievements
Rank 1
Jacob asked on 15 Feb 2012, 07:29 PM
Hello,

I use a grid inside my website. Now i want to add a upload field to this grid to upload images. And also add radio buttons.

Is this possible? I can't find a list of supported element types.

Regards,
Jacob

6 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 20 Feb 2012, 03:32 PM
Hi Jacob,

You can use Kendo Templates to add an inputs in the grid. In the attachments you can find a demo showing this approach in action.

Greetings,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Joel
Top achievements
Rank 1
answered on 20 Feb 2012, 09:15 PM
Alexander,

Interesting use of templates there. What would be the easiest way to have a radio button item selected based on a value specified in the localData datasource? Using some form of row databound event?

Thanks,
Joel 
0
Alexander Valchev
Telerik team
answered on 21 Feb 2012, 03:44 PM
Hi Jacob,

One possible solution is to use the dataBound event to read the data and implement the logic. It would be best to set the id or the name attribute of the inputs with Kendo template. Thus way it will be easier to select the radio buttons via jQuery. Please check the following example:
var radioBtns = '<form><input id="#=Id#" class="radioBtnMale" type="radio" name="sex" value="male" /> Male<br /><input class="radioBtnFemale" type="radio" name="sex" value="female" /> Female</form>';

I have updated the project to illustrate the approach.

Regards,
Alexander Valchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Joel
Top achievements
Rank 1
answered on 22 Feb 2012, 05:33 PM
Thanks Alexander ... that helps a lot!
0
Mark
Top achievements
Rank 1
answered on 16 Nov 2012, 01:20 PM
Excellent example,
I have difficulty adding event to Upload control,
Do you think you could provide example how to actually upload the file.
I am trying to modify it to have async call:

    $("#grid").kendoGrid({

        dataSource: dataSource,

        dataBound: function (e) {

            $("input[type='file']").kendoUpload({

                async: {

                    saveUrl: "save",

                    removeUrl: "remove",

                    autoUpload: true

                }

                ,

                events: {

                    upload: "onUploaded",

                    error: "onFailed"

                }

            });

            ;



0
jose
Top achievements
Rank 1
answered on 19 Dec 2012, 06:11 PM
Really good post. From not knowing how to do it to actually implementing it in 30 minutes! Excellent!
Tags
Grid
Asked by
Jacob
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Joel
Top achievements
Rank 1
Mark
Top achievements
Rank 1
jose
Top achievements
Rank 1
Share this question
or