Telerik Forums
Kendo UI for jQuery Forum
0 answers
75 views
It seems that the kendo ui only suppert to pass the parameter like string,int ,but not List<student> this custom class.

ActionResult GetStudentImfo([DataSourceRequest] DataSourceRequest request, string name, int id)
this format is OK,but
ActionResult GetStudentImfo([DataSourceRequest] DataSourceRequest request,List<student>) is not OK.
xi
Top achievements
Rank 1
 asked on 12 May 2013
1 answer
530 views
For some reason the delete dialog is firing twice.  It doesn't call the destroy function until after you go through both dialogs.

Any ideas?

001.<div id="grid"></div>
002. 
003.<script>
004.    $(document).ready(function() {
005.        var crudServiceBaseUrl = "main.php?a=quotereport", dataSource = new kendo.data.DataSource({
006.            transport : {
007.                read : {
008.                    url : crudServiceBaseUrl + "&read=1",
009.                    dataType : "json"
010.                },
011.                destroy : {
012.                    url : crudServiceBaseUrl + "&destroy=1",
013.                    dataType : "json"
014.                },
015.                parameterMap : function(options, operation) {
016.                    if (operation !== "read" && options.models) {
017.                        return {
018.                            models : kendo.stringify(options.models)
019.                        };
020.                    }
021.                }
022.            },
023.            batch : true,
024.            schema : {
025.                data: "data",
026.                total: "total",
027.                model : {
028.                    id : "id",
029.                    fields : {
030.                        id: {
031.                            validation : {
032.                                required : true
033.                            }},
034.                        first_name: {
035.                            validation : {
036.                                required : true
037.                            }},
038.                        last_name: {
039.                            validation : {
040.                                required : true
041.                            }},
042.                        dob: {
043.                            validation : {
044.                                required : true
045.                            }},
046.                        email: {
047.                            validation : {
048.                                required : true
049.                            }},
050.                        phone: {
051.                            validation : {
052.                                required : true
053.                            }},
054.                        age: {
055.                            validation : {
056.                                required : true
057.                            }},
058.                        date: {
059.                            validation : {
060.                                required : true
061.                            }}
062.                    }
063.                }
064.                }
065.        });
066. 
067.        $("#grid").kendoGrid({
068.            dataSource : dataSource,
069.            pageable : false,
070.            height : 430,
071.            editable: 'inline',
072.            columns : [{
073.                field : "id",
074.                title : "ID"
075.            }, {
076.               field  : "date",
077.               title  : "Date"
078.            }, {
079.                field : "first_name",
080.                title : "First Name"
081.            }, {
082.                field : "last_name",
083.                title : "Age"
084.            }, {
085.                field : "dob",
086.                title : "Birthday"
087.            }, {
088.                field : "email",
089.                title : "Email"
090.            }, {
091.                field : "phone",
092.                title : "Telephone"
093.            }, {
094.                field : "age",
095.                title : "Age"
096.            },           
097.            {
098.                command : ["destroy"],
099.                title : " ",
100.                width : "160px"
101.            }]
102.        });
103. 
104.    });
105.</script>
Jayesh Goyani
Top achievements
Rank 2
 answered on 12 May 2013
4 answers
950 views
Hi,

I am trying to work out a way to use the Upload Async control to upload a single file multiple times. 

The situation is the user will be able to upload a receipt file (most likely a pdf) for an expense they incurred which will go along with a few other attributes such as price and category. The data collected will be done using Knockout as part of an ASP.NET MVC site. They will be able to add multiple expenses but only one receipt file to go along with it.

So I want to be able to have a form which has the other attributes as well as the ability to upload a receipt to go along with it. However I want the upload event to be fired when they click "Add Expenditure" and the remove event to be called when they click "Remove Expenditure".  Is there a way to manually call these events?

Thanks.
Gabriel
Top achievements
Rank 1
 answered on 12 May 2013
2 answers
283 views
Hello,

I'm new to Kendo UI framework but i have some experience with jQuery / AJAX.

I have problem with submiting value from my JS script to php file (simple AJAX works fine).

Here are my both php and js code.

var userList = new kendo.data.DataSource({
                transport: {
                    read: {
                        url: "php/usersModel.php",
                        dataType: "json"},
                        data: {operationCode:"showUsers"},
                        type: "post"
                     
                            
                },
                pageSize:10
                 
                 
            });
Without posting data it works fine (I tried with one-funciton-only php file). But in php file i have Switch function, every time my usersModel.php is requested i POST operationCode. When operationCode =="showUsers", showUsers function should be called, when I POST "showLogs" showLogs funciton in PHP file should be called.

In Chrome Console im getting this error: Uncaught TypeError: Cannot read property 'slice' of null.
There is my php code:
$operationCode = $_POST['operationCode'];
$conn= new MySQLI($host,$user,$DBpassword,$baza);
 
if (!empty($operationCode))
{
    Switch($operationCode)
        {
        case "deleteUser" :
            if (!empty($id))
                    {
                    deleteUser($id,$conn,$baza);
                    }
            break;
             
        case "showUsers" :
            showUsers($conn,$baza);
            break;  
        case "addUser" :
            addUser($baza,$conn,$serializedData,$operationCode);
            break;
        case "editUser":
            editUser($conn,$baza,$serializedData,$operationCode);
            break;
        case "showLogs":
            showLogs($conn);
            break;
        }
}
 
function showUsers($conn,$baza)
{
     
    $queryString="select id,username,email,telefon,imie,nazwisko,userlevel from ".$baza.".users t1 left join user_dane t2 on t1.id=t2.userid where t1.userlevel<>9 order by t1.id";
    $results=mysqli_query($conn,$queryString);
 
        $usersResult = array();  
        while ($row=mysqli_fetch_assoc($results))
        {
             
             
            array_push($usersResult,
                       array('id'=>$row['id'],
                             'username'=>$row['username'],
                             'email'=>$row['email'],
                             'telefon'=>$row['telefon'],
                             'userlevel'=>$row['userlevel'],
                             'imie'=>$row['imie'],
                             'nazwisko'=>$row['nazwisko']
                              
                             )
                        
                        
                       );
                      
        }
        echo json_encode($usersResult);
         
}

Of course db,host and other variables are defined properly.

I hope someone here is able to help me. And sorry for my !perfect English ;)

Best regards.
Hemant
Top achievements
Rank 1
 answered on 11 May 2013
7 answers
621 views
Hi Team,

I have a grid in web user control and I am dynamically adding that user control in Asp.net Web Forms(not MVC architecture). I want to show the kendo ui chart dynamically for each and every instance of web user control under the grid. All the examples in web for kendo ui provides a static div with id as chart  " <div id="chart"></div>". But requirement is I want to show the chart dynamically. For example I am dynamically creating two user controls(control1,control2) each have different datasource. I want the kendo chart to be shown under this web user control. Can anyone provide a solution to this.

Thanks,
R.Jaganathan
jagan
Top achievements
Rank 1
 answered on 11 May 2013
4 answers
422 views
Please look at the attached image. There is a white space above the grid header. Why does this happen?

This is the default kendo theme and there is nothing else on this page. It is the default web site template in VS 2010 for MVC 4. No styles have been modified.

@(Html.Kendo().Grid<OpenXMLDemo.Models.AppointmentsDTO>().Name("Appointments")
                .Columns(columns =>
                {
                    columns.Bound(o => o.FirstName).Title("First Name").Width(80);
                    columns.Bound(o => o.LastName).Title("Last Name").Width(80);
                    columns.Bound(o => o.ClientMemberID).Title("ID").Width(80);
                    columns.Bound(o => o.ClientName).Title("Client").Width(80);
                    columns.Bound(o => o.VendorName).Title("Vendor").Width(90);                   
                    columns.Bound(o => o.ProviderID).Title("Provider ID").Width(75);
                    columns.Bound(o => o.NPI).Title("NPI").Width(70);
                    columns.Bound(o => o.AppointmentDateDisplay).Title("Date/Time").Width(120);         
                })
                .DataSource(dataSource => dataSource
                    .Ajax()
                    .Read(read => { read.Action("BindAppointments", "Home"); }))
                
                )
Eric
Top achievements
Rank 1
 answered on 10 May 2013
1 answer
110 views
Hi,
I've been fighting this issue all day, trying to make sense of it and why would the first check the function does fails:
            if (value instanceof Date) {
                return value;
            }

It turns out that when you're passing around information across frames (iframe), the instanceof does not recognize it as a date anymore (but it is). So the function goes on to assume it's a string and tries to call value.indexOf(...) and that of course fails because it's not a string.

After some investigation I ran across a solution to this, and that would be to change this initial check from what it was to:
            if (Object.prototype.toString.call(value) === '[object Date]') {
                return value;
            }

I tested it in my environment and it works. I'm attaching a test case so you can verify. Hope you can fix this soon, be it with my suggestion or by any other means.
Thanks a lot!
Andrés
Georgi Krustev
Telerik team
 answered on 10 May 2013
1 answer
622 views
Hi,

I would like to combine the autocomplete functionality with the inline edit functionality inside a Kendo Grid. Is this possible and if so, where can I get a sample or documentation regarding this?

Thanks for your assistance.
Iliana Dyankova
Telerik team
 answered on 10 May 2013
13 answers
1.9K+ views
Hello,

I want to add the tooltip dynamically based on some conditions to my date picker when the user changes the date using JQuery. how i can do that? below is my data picker

@(Html.Kendo().DatePicker()
 .Name("dtTDate")
 .Value(Model.TDate)
 .Format("dd-MMM-yyyy")
 .HtmlAttributes(new { style = "width:120px"}))


Regards,
Ravi
Dimo
Telerik team
 answered on 10 May 2013
1 answer
309 views
Just spent about 30 minutes trying to figure out why my Htmlattribute object was causing the grid to crash. Turns out, it's because the value for "style" requires no spaces (e.g. style = "text-align:center" instead of "text-align: center"). Thought I'd share in case anyone else is having the same problem.

Note for Telerik team: might it be possible to remove the no-space requirement? It's not intuitive and extremely frustrating for the uninitiated!
Dimo
Telerik team
 answered on 10 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?