Telerik Forums
Kendo UI for jQuery Forum
0 answers
73 views
Hi everybody

I have a problem with the Add button in the grid.
I'm doing some tests and something strange happened.
By clicking the Add button, a popup appears with the fields, an ok button and cancel the other. Sometimes when I click the cancel button, a row is inserted with all null values ​​and add button stops working. The code is this:

    .Columns(columns =>
    {
        columns.Bound(p => p.Isn);
        columns.Bound(p => p.EventoIsn);
        columns.Bound(p => p.UsuarioEdicao);
        columns.Bound(p => p.ValorCaptacao);
        columns.Bound(p => p.Processado);
    })
    .ToolBar(toolbar => {
        toolbar.Create().Text("");
    })
    .DataSource(dataSource => dataSource
        .Ajax()
        //.Server()
        .Model(model => model.Id(p => p.Isn))
        .Create(update => update.Action("Create", "CaptacaoItem"))
    )
    .Editable(editable => editable.Mode(GridEditMode.PopUp)
        .Window(w => w.Title("Captação Item")
            .HtmlAttributes(new { @id = "fLogin" })
            .Height(700)
            .Width(700)
            .Resizable())))
Duan
Top achievements
Rank 1
 asked on 07 Aug 2012
1 answer
366 views
Hi.  I have an MVC3 application programmed in VB.NET.

In this MVC3 application, I have a controller.  The controller's JSON action has 3 parameters as specified below:

        Function JSONRetrieveDocuments(
            ByVal contactId As Guid,
            ByVal includeLoanBasedDocuments As Boolean,
            <DataSourceRequest()> request As DataSourceRequestAs ActionResult

As part of a Grid, I build a route value dictionary as part of the function that creates the CrudOperationBuilder:

        Public Function CreateCrudOperationBuilder(cob As Kendo.Mvc.UI.Fluent.CrudOperationBuilderAs Kendo.Mvc.UI.Fluent.CrudOperationBuilder
            Dim theRouteValueDictionary As New RouteValueDictionary()
 
            theRouteValueDictionary.Add("contactId", Request.QueryString("contactId"))
	    'theRouteValueDictionary.Add("includeLoanBasedDocuments", ???
           Return cob.Action("JSONRetrieveDocuments""ContactBasedDocument", theRouteValueDictionary)         End Function

When making the call to JSONRetrieveDocuments, I want to be able to populate the includeLoanBasedDocuments parameter of the controller's action by simply returning the checked status of a checkbox...  so I created this javascript function:

    function ShouldIncludeLoanBasedDocuments() {
        return $("#cbIncludeLoanBasedDocuments")[0].checked;
    }


I'm curious 
a) how do I supply the result of the javascript function to the route values?
b) am I following best practices on this one?   It seems like this would be a common operation, but I couldn't find any documentation on it.

Thanks,

Jason
Jason
Top achievements
Rank 1
 answered on 07 Aug 2012
0 answers
81 views
I need to be able to set the focus to a cell during DataBound. Can anyone provide an example of how to do that?
the column is : 
columns.Bound(o => o.QtyCurrentlyReceived).Width(75).Title("Qty Curr Rx"); 


AkAlan
Top achievements
Rank 2
 asked on 07 Aug 2012
1 answer
1.3K+ views
hi all, how can I create a hidden column in the table?

columns: [ {
                                field: "NedP",
                                title: "Населенный пункт",
                                template: "<div > ${ NedP } </div>"
                                }]

Table does not have the properties of hidden (visible)
Dark
Top achievements
Rank 1
 answered on 07 Aug 2012
2 answers
87 views
I can't for the life of me see how to search the forums!

Can someone please explain where this is hidden?

Many thanks,

Kevin
Kevin
Top achievements
Rank 1
 answered on 07 Aug 2012
1 answer
103 views
Hi,

I want to perform an ajax call only when next and previous navigation happens.
How can i get a handle on these events?

I get the month and year like this but how can i tell if the user is navigating forward or back a month?
var month = this._current.getMonth() + 1;
var year = this._current.getFullYear();

.Events(events => events 
                                        .Change("goToDate")
                                        .Navigate("goToMonth"))

Thank you.
Gilbert
Top achievements
Rank 1
 answered on 07 Aug 2012
0 answers
58 views
my grid

$("#grid").kendoGrid({
                        change: onChange,
                        selectable: "multiple",
                       .......
                       )}

        function onChange(arg) {
            this.select().text();    // get text
                                     // and how can I get a line number in the grid on change
                          }

thanks
Igor
Top achievements
Rank 1
 asked on 07 Aug 2012
1 answer
702 views
Hi There,

I have a problem handling the click event of a anchor element inside a Kendo grid.
I have enabled the grid to be Selectable with single select option. 
I have also registered a javascript function for Change event of the kendo grid.

I have a column in the grid which has a link and on click of that link I have to open a kendo window.

The problem - OnChange event of the grid fires first and checks the checkbox in column #1 of the grid and then opens the kendo window. 

The actual behavior I am looking for is not checking the check box and only opening the kendo window.

Here is the code what it looks like in javascript.

jQuery(function(){
jQuery(
"#customerList").kendoGrid({
change:updateCusterRow,
columns:[
{title:
"\u003cinput checked=\"checked\" disabled=\"true\" id=\"chkCust\" name=\"chkCust\" type=\"checkbox\" value=\"true\" /\u003e\u003cinput name=\"chkCust\" type=\"hidden\" value=\"false\" /\u003e",attributes:style:"border:none;"},width:"35px",template:"\r\n                    #if (Selected == \u0027Y\u0027){ #\r\n                            \u003cinput type=\u0027checkbox\u0027 id=\u0027chk_#=Id#\u0027 checked /\u003e\r\n                    # } else { #\r\n                        \u003cinput type=\u0027checkbox\u0027 id=\u0027chk_#=Id#\u0027 /\u003e\r\n                    # } #",field:"Selected",sortable:false,encoded:true},
{title:
"Cust #",attributes: {style:"border:none;"},width:"70px",field:"Code",encoded:true},
{title:
"Company Name",attributes {style:"border:none;"},width:"370px",field:"CompanyName",encoded:true}, {title:"Type",attributes: {style:"border:none;"},width:"100px",field:"Type",encoded:true},
{title:
" ",attributes:{style:"border:none;"},width:"100px",template:"\u003ca style=\"text-decoration:underline\" href=\u0027javascript:op enKendoDialog(\"editCustomer\")\u0027\u003eEdit Cust\u003c/a\u003e",field:"Id",sortable:false,encoded:true},{title:" ",attributes:{style:"border:none;"},width:"100px",template:"\u003ca style=\"text-decoration:underline\" href=\u0027javascript:openKendoDialog(\"userShippingFavorites\")\u0027\u003eShipTos\u003c/a\u003e",field:"Id",sortable:false,encoded:true}],sortable:true,selectable:"Single, Row",
toolbar:{},
dataSource:{transport:{read:{url:
""}},type:"aspnetmvc-ajax",schema: {data:"Data",total:"Total",errors:"Errors",model:{id:"Id",fields:{Id: {type:"number",defaultValue:null},Code:{type:"string"},CompanyName: {type:"string"},Type:{type:"string"},Box:{type:"string"},Sheet: {type:"string"},Selected:{type:"string"},Modified: {type:"string"},DirectOrderFlag:{type:"string"},ShipTos: {type:"object"}}}}}});});

In internet explorer I could check the element which was clicked using window.event.srcElement and decide whether to check/uncheck the checkbox or open the window, but not sure how to do this in for firefox and other browser.

Thanks,
Nilesh
Alexander Valchev
Telerik team
 answered on 07 Aug 2012
1 answer
49 views
Is it possible to have a gauge with a barIndicator emanating from a given point in the range? e.g. Where a gauge has a range of -50 to 50, can the barIndicator emanate from 0 rather than the default of -50?
Hristo Germanov
Telerik team
 answered on 07 Aug 2012
4 answers
302 views
I cannot implement nested drop target. For example, I have 2 types of elements, control and container. Both of them are draggable, and container is drop target.

<div id="control">control</div>

<div id=
"base" style="width:600; height:400">
<div id="container1" style="width:200; height:100"></div>
<div id="container2" style="width:200; height:100"></div>
</div>

<script> 
$(document).ready(function() {
$("#control","#container1","#container2").kendoDraggable({
hint: function(e) { return e.clone();}
});

$(
"#base","#container1","#container2").kendoDropTarget({
drop: function(e) { this.element.append(e.draggable.currentTarget.clone()); }
});
});
</script>

Whenever I drop the control to "base" or "container1" or "container2", the drop event was only triggered by "base" only. Can I trigger the drop event in "container1" if I drop the control into it?

Thank you.


Nohinn
Top achievements
Rank 1
 answered on 07 Aug 2012
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?