我有以下HTML表格(datatable jquery插件):
表格的每一行都有一个带有ID号的input type = "hidden" name = WorkOrderID[]
。
我希望以数组形式提交图像中标有蓝色和绿色的下拉列表的值,如下所示:
array(
0=>
[WorkOrderID] : 10
[BlueDropdown] : 14
[GreenDropdown] : 22,
1=>
[WorkOrderID] : 11
[BlueDropdown] : 45
[GreenDropdown] : 7,
2=>
[WorkOrderID] : 12
[BlueDropdown] : null (in case no value was selected)
[GreenDropdown] : 69,
)
我不是一名前端开发人员,因此我对HTML和JS的了解基本上是空的。
你能伸出援助之手吗?我需要使用JQuery
答案 0 :(得分:1)
运行以下代码。这可能是你正在寻找的东西。检查控制台输出。检查元素>控制台
TAlgoResult HeavyAlgorithm() {/* Here is algorithm routine */};
QFuture<TAlgoResult> RunHeavyAlgorithmAsync()
{
QtConcurrent::run([&](){return HeavyAlgorithm();});
}
// class which calls algo
class AlgoCaller
{
QFutureWatcher<TAlgoResult> m_future_watcher;
QDialog* mp_modal_dialog;
AlgoCaller()
{
QObject::connect(&m_future_watcher, &QFutureWatcher<void>::finished,
[&]()
{
mp_modal_dialog->close(); // close dialog when calculation finished
})
}
void CallAlgo() // to be called from main thread
{
mp_modal_dialog->show(); // show dialog before algo start
m_future_watcher.setFuture(RunHeavyAlgorithmAsync());
// start algo in background
// main thread is not blocked and events can be processed
}
};