mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 09:18:53 +00:00
feat(esx_menu_list): return currentRow with data
This commit is contained in:
@@ -12,11 +12,7 @@ CreateThread(function()
|
||||
name = name,
|
||||
data = data
|
||||
})
|
||||
|
||||
ESX.SetTimeout(200, function()
|
||||
SetNuiFocus(true, true)
|
||||
end)
|
||||
|
||||
SetNuiFocus(true, true)
|
||||
end
|
||||
|
||||
local function closeMenu(namespace, name)
|
||||
@@ -46,11 +42,9 @@ CreateThread(function()
|
||||
|
||||
RegisterNUICallback('menu_submit', function(data, cb)
|
||||
local menu = ESX.UI.Menu.GetOpened(MenuType, data._namespace, data._name)
|
||||
|
||||
if menu.submit ~= nil then
|
||||
if menu.submit then
|
||||
menu.submit(data, menu)
|
||||
end
|
||||
|
||||
cb('OK')
|
||||
end)
|
||||
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
let menu = $(Mustache.render(MenuTpl, view));
|
||||
|
||||
menu.find('button[data-namespace][data-name]').click(function() {
|
||||
ESX_MENU.data[$(this).data('namespace')][$(this).data('name')][parseInt($(this).data('id'))].currentRow = parseInt($(this).data('id')) + 1;
|
||||
ESX_MENU.submit($(this).data('namespace'), $(this).data('name'), {
|
||||
data : ESX_MENU.data[$(this).data('namespace')][$(this).data('name')][parseInt($(this).data('id'))],
|
||||
value: $(this).data('value')
|
||||
|
||||
Reference in New Issue
Block a user