feat(esx_menu_list): return currentRow with data

This commit is contained in:
Mycroft
2022-09-08 23:48:34 +01:00
parent 0e699c81ee
commit 04b237a7e6
2 changed files with 3 additions and 8 deletions
+2 -8
View File
@@ -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)
+1
View File
@@ -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')