No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    New control request

    Framework
    2
    4
    299
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      tdumitr last edited by

      I have a request for a new control. I am working on an Electron-based app, where I need to select a folder. The app will run on Windows.

      I am looking for a control similar to QFile, but which opens the “Select Folder” native Windows dialog instead of the Open File Dialog.

      1 Reply Last reply Reply Quote 0
      • T
        tdumitr last edited by

        Never mind. Adding the webkitdirectory attribute to the QFile does the job.

        1 Reply Last reply Reply Quote 0
        • T
          tdumitr last edited by tdumitr

          I take that back. While the visual appearance suggests selecting a folder, in reality, the control’s value is either a file from the selected folder (I don’t know how it selects the file, but for the same folder it is consistently the same file), or, if the folder is empty, undefined. This makes it useless as a folder selection mechanism.

          Bottom line, my request is back.

          1 Reply Last reply Reply Quote 0
          • S
            sakon54321 last edited by

            selectFolder (title = 'Select directory...') {
              const { remote } = require('electron')
              var dialog = remote.dialog
            
              var browserWindow = remote.getCurrentWindow()
              var options = {
                title: title,
                properties: ['openDirectory']
              }
            
              const openDialog = dialog.showOpenDialog(browserWindow, options)
              openDialog.then(result => {
                console.log(result.canceled)
                console.log(result.filePaths)
              }).catch(err => {
                console.log(err)
              })
            },
            1 Reply Last reply Reply Quote 0
            • First post
              Last post