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

[Solved] Refresh Data in cell while editing

0 Answers 84 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jonisan
Top achievements
Rank 1
Jonisan asked on 17 May 2012, 09:47 AM
Hello ,

I have a normal grid to witch I do Ajax editing. Some columns in the grid are readonly and the value
of this columns is calculated with the value of close by columns. I get the OnEditValue event and I try to change the value
in the readonly cell:
 function onEditFK(e)
{       
             if (e.value == "0") {                 
                 document.getElementById('qTons').readOnly = false;
                 document.getElementById('qTons').style.backgroundColor = 'white';
             } else {               
                 document.getElementById('qTons').readOnly = true;
                 document.getElementById('qTons').style.backgroundColor = 'gray';
                 $.post('<%=Url.Action("CalculateTons", "Quarry")%>',
                     { value: e.value },
                     function (result) {
                         document.getElementById('qTruckValue').value = result;
                         document.getElementById('qTons').value = result * document.getElementById('qLoadCountNr').value;
                         document.getElementById('qTruckValue').focus();
                         document.getElementById('qTons').focus();
                     });
             }
         }


My problem is that qTons is readOnly and the focus() gives an error in IE8 . Is there a way to refresh the value in qTons while editing ?
Tags
Grid
Asked by
Jonisan
Top achievements
Rank 1
Share this question
or