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

Set focus on added new row? (grid)

6 Answers 830 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve Palm
Top achievements
Rank 1
Steve Palm asked on 15 Aug 2012, 12:27 AM
Hi,

How can I set focus on my added new row?
In my case, I insert new row at the bottom..

Thanks...

6 Answers, 1 is accepted

Sort by
0
Iliana Dyankova
Telerik team
answered on 15 Aug 2012, 07:52 PM
Hi Steve,

I am not sure if I understand you correctly - by design the focus is on the newly inserted row in Kendo UI Grid. Could you please provide more detailed information or even best send a small but runnable project which illustrates your current implementation? This way I will be able advice you further and provide the most appropriated solution if such is possible. Thank you in advance for your cooperation.

Regards,
Iliana Nikolova
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Steve Palm
Top achievements
Rank 1
answered on 16 Aug 2012, 02:01 AM
Hi Iliana ,

I don't have much time to create a sample project for you.. BUT you can try this at your "Kendo.Mvc.Examples" project..
Kindly check my screenshot for more details..

Thanks...
0
Petur Subev
Telerik team
answered on 20 Aug 2012, 03:50 PM
Hello Steve,

I tried to reproduce your issue but to no avail. Please check the video link below:
http://screencast.com/t/TuvRMo4qR 

Do we miss something on our side? Also did you try with the latest version?

Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Steve Palm
Top achievements
Rank 1
answered on 22 Aug 2012, 12:40 AM
Hi Petur,

Yes, it will work at Inline editing but not at Batch Editing..
Here's a code snippet.. :)
Kendo().Grid...........................
.Editable(editable => editable.Mode(GridEditMode.InCell).CreateAt(GridInsertRowPosition.Bottom))
    .Sortable()
    .Scrollable()
    .DataSource(dataSource => dataSource       
        .Ajax()        
        .Batch(true)
        .ServerOperation(false)
        .Events(events => events.Error("error_handler"))
        .Model(model =>
        {
            model.Id(p => p.ProductID);
            model.Field(p => p.ProductName).Editable(false);
        }) 
        .Create("Editing_Create", "Grid")
.....................


Thanks..
0
Petur Subev
Telerik team
answered on 24 Aug 2012, 01:37 PM
Hi Steve,

Basically the grid tries to put the first cell into edit mode. You can move that column so the first column becomes editable or you can work-around this with the following logic executed on the Change event of the dataSource.
function OnDSChange(e){
    var cell = $('#Grid').find('tbody tr:eq('+e.index+') td:eq(1)'); // or different cell
    $('#Grid').data('kendoGrid').editCell(cell);
}


All the best,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Steve Palm
Top achievements
Rank 1
answered on 12 Sep 2012, 12:32 AM
Hi,
I bind this at "edit" event and it seems that "e.index" is not getting the right row.. but it works if I input a number...
var grid1 = $('#BalanceSheetRowsRowComponentGrid').data("kendoGrid");
 
grid1.bind("dataBound", function (e) {
 
var cell = $('#BalanceSheetRowsRowComponentGrid').find('tbody tr:eq(' + e.index + ') td:eq(1)');
$('#BalanceSheetRowsRowComponentGrid').data('kendoGrid').editCell(cell);
 
        });

Thank...
Tags
Grid
Asked by
Steve Palm
Top achievements
Rank 1
Answers by
Iliana Dyankova
Telerik team
Steve Palm
Top achievements
Rank 1
Petur Subev
Telerik team
Share this question
or