Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/436.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在jqgrid中,如何在编辑模式下使文本向右对齐_Javascript_Jquery_Jqgrid - Fatal编程技术网

Javascript 在jqgrid中,如何在编辑模式下使文本向右对齐

Javascript 在jqgrid中,如何在编辑模式下使文本向右对齐,javascript,jquery,jqgrid,Javascript,Jquery,Jqgrid,我在jqgrid中有一个自定义的列格式设置程序,在编辑模式下,它总是向左对齐。如何使其与右侧对齐 这是colModal和自定义格式化程序的一部分,其中一些列是可编辑的 colModel: [ { name: 'col10', width: '70px', fixed: true, align: right', formatter:percentFomatter, editable: true }, { name: 'col11', width

我在jqgrid中有一个自定义的列格式设置程序,在编辑模式下,它总是向左对齐。如何使其与右侧对齐


这是colModal和自定义格式化程序的一部分,其中一些列是可编辑的

    colModel: [ { name: 'col10', width: '70px', fixed: true, align: right',
                  formatter:percentFomatter, editable: true }, 
    { name: 'col11', width: '70px', fixed: true, align: 'right', formatter: percentFomatter, editable: true }, 
    { name: 'col12', width: '70px', fixed: true, align: 'right' } ], function percentFomatter(cellvalue, options, rowObject) { return cellvalue + '%'; }; 

您可以使用
editoptions:{datainit:…
将样式应用于正在编辑的元素

e、 g


我已经创建了一个小演示

请展示一些代码-这样我们可以更好地帮助您。这是colModal和自定义格式化程序的一部分,其中一些列是可编辑的。谢谢。colModel:[{名称:'col10',宽度:'70px',固定:true,对齐:'right',格式化程序:percentFomatter,可编辑:true},{name:'col11',width:'70px',fixed:true,align:'right',formatter:percentfomate,editable:true},{name:'col12',width:'70px',fixed:true,align:'right'},function percentfomate(cellvalue,options,rowObject){return cellvalue+'%';};
...
...
align: "right",
editable:true,
editoptions: {dataInit:function(e){
                e.style.textAlign = 'right';                            
             }}
...
...