0

I have used dojo grid to display my table.I have a requirement that when I click on add a new row should be added .I am able to achieve it but the problem is in the newly added row am not able to move focus from one field to other not able to enter space in the text field. Tab press is not going to next text field. can some one help me on this..

this is my dojo grid:

var gridLayout = createLayout(columnHeadings,columnAttributes,columnWidths);
var gridStyling = "height:"+height+";width:"+width+";";

grid = new DataGrid(
    {
        id                  : 'grid'+gridId,
        store               : objectStore,
        structure           : gridLayout,
        escapeHTMLInData    : false,
        rowSelector         : '0px',
        canSort             : false,
        style               : gridStyling,
        noDataMessage       : noDataMessage,
        autoHeight          : false,
        singleClickEdit     : singleClickEdit
    },
    document.createElement('div')
);

adding row like below :

function addNewRow(index){

    var newItem = {};

    newItem['selectHTML']   = "<input id='"+index+"' name='newRow' value = 'true' type='radio'>";
    newItem['operatorId']   = "<input type='text' maxlength=4 style='width:100px' id='operatorId"+index+"'>";
    newItem['operatorName'] = "<input type='text' maxlength=50 style='width:100px' id='operatorName"+index+"'>";
    newItem['operatorType'] = getCombo( _this.context.options.operatorType.get("value"),"operatorType"+index , "" );


    _this.context.binding.get("value").add(newItem);
}
2
  • Please provide some code or a small working example. It's hard to help you when we don't know what your code looks like. Commented Apr 27, 2015 at 13:24
  • once the row is added am trying to get focus on the html element.But focus is not happening Commented Apr 27, 2015 at 13:44

0

Browse other questions tagged or ask your own question.