Put the text first in front of the check box when editing in a grid

I have a gird and one of the fields uses a check box. When I open the edit dialog the check box appears in front of the text. is it possible to put the text first?



1 Reply

SK Sujith Kumar Rajkumar Syncfusion Team August 2, 2021 01:01 PM UTC

Hi Danyelle, 
 
Greetings from Syncfusion support. 
 
Based on the provided information we suspect that your requirement is to change the edit checkbox label position as before in the Grid’s dialog editing. If so, you can achieve it by retrieving the checkbox control instance and setting its ‘labelPosition’ property as ‘Before’ in the Grid’s actionComplete event handler. 
 
This is demonstrated in the below code snippet, 
 
// Grid’s actionComplete event handler 
function actionComplete(args) { 
    // Condition to be executed on Grid add/edit action 
    if (args.requestType === 'add' || args.requestType === 'beginEdit') { 
        // Edit checkbox instance is retrieved  
        var checkObj = args.form.querySelector('.e-checkbox').ej2_instances[0]; 
        // Checkbox label position is changed to before the control 
        checkObj.labelPosition = "Before"; 
        // Can be used to add space between the label and the checkbox 
        checkObj.element.parentElement.querySelector(".e-label").style.marginRight = '10px'; 
    } 
} 
 
 
If we misunderstood your query or if you require any further assistance, then please get back to us. 
 
Regards, 
Sujith R 


Loader.
Up arrow icon