我正在为 Prestashop 1.6 构建一个非常简单的模块,并添加了一个管理界面,允许列出我的记录,一个用于添加、编辑和删除的表单。
正如您在这里看到的那样,这工作正常:

问题是可拖动的重新排序按钮不可拖动。因此重新排序不起作用......
根据官方文档,如果您在控制器中设置位置选项,您将获得可拖动功能:
['position'] => 'position', // If set to position, the field will display arrows and be drag and droppable, which will update position in db (optional).
Run Code Online (Sandbox Code Playgroud)
这是我的模块控制器的相关部分:
$this->fields_list = array(
'id_quicklinks' => array(
'title' => $this->l('ID'),
'align' => 'center',
'width' => 25
),
'titulo' => array(
'title' => $this->l('Titulo'),
'width' => 'auto'
)
, 'lead' => array(
'title' => $this->l('Subtitulo'),
'width' => 'auto'
),
'position' => array(
'title' => $this->l('Ordem'),
'filter_key' => …Run Code Online (Sandbox Code Playgroud) 我从 MainActivity 触发 AlertDialog,它工作正常,如下所示:
public void showCustomAlert(String text){
final String alertText = text;
runOnUiThread(new Runnable() {
@Override
public void run() {
AlertDialog.Builder myDialogBox = new AlertDialog.Builder(mContext);
myDialogBox.setTitle("Alert");
myDialogBox.setMessage(alertText);
myDialogBox.setCancelable(false);
myDialogBox.setPositiveButton("OK", new DialogInterface.OnClickListener(){
public void onClick(DialogInterface dialog, int whichButton) {
dialog.dismiss();
}
});
myDialogBox.setNegativeButton("Cancel", new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
AlertDialog alertDialog = myDialogBox.create();
alertDialog.show();
}
});
}
Run Code Online (Sandbox Code Playgroud)
当我在 MainActivity 之上打开另一个活动并再次触发 AlertBox 时,问题就出现了:它位于该活动的后面。当我关闭活动时,它就在那里:AlertDialog 正在显示。
如何让这个 AlertDialog 始终显示在顶部?
注意:此 AlertDialog 是由我的 MainActivity 上的推送通知侦听器触发的,而不是通过单击侦听器触发。