Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editing Sub Title #60

Open
GamerYeshe opened this issue Jan 28, 2024 · 1 comment
Open

Editing Sub Title #60

GamerYeshe opened this issue Jan 28, 2024 · 1 comment

Comments

@GamerYeshe
Copy link

I want to change the subtitle for storemenu2 to contain the text used in qb-input.
I use storemenu2.subtitle = storename and it works the first time I open the menu. It shows correctly.
Then when I try to open the menu for a second time, storemenu2.subtitle still shows the correct title string, but the menu itself shows the default subtitle.
Any way around this?

local storemenu2 = MenuV:CreateMenu(false, Lang:t('menu.edit_title'), menuLocation, 220, 20, 60, 'size-125', 'none', 'menuv', 'edit2')

`edit_store_menu:On('select', function(_) -- Open Menu To Edit Existing Store
local dialog = exports['qb-input']:ShowInput({
header = "Store Editing",
submitText = "Confirm",
inputs = {
{
text = "Store Name You Want To Edit", -- text you want to be displayed as a place holder
name = "namestore", -- name of the input should be unique otherwise it might override
type = "text", -- type of the input
isRequired = true, -- Optional [accepted values: true | false] but will submit the form if no value is inputted
-- default = "CID-1234", -- Default text option, this is optional
}
},
})

if dialog ~= nil then
    local storename = nil
    for k,v in pairs(dialog) do
        if k == "namestore" then
            storename = v
        end
    end

    QBCore.Functions.TriggerCallback('core_stores:server:checkStoreName', function(cb)

        if cb then
            MenuV:OpenMenu(storemenu2)
            storemenu2.subtitle = storename
            oldStoreName = storename
        end
    
    end, storename)
end

end)
`

@GamerYeshe
Copy link
Author

Nevermind, sorted!
storemenu2.AddSubtitle, instead of .subtitle for others who have also been wondering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant