by drakinite » Fri Nov 19, 2021 12:47 pm
Great!
MPG wrote: ↑Fri Nov 19, 2021 11:58 am
1) I take the value of the textbox and save it to the tracklist using:
trackLst.getValue(currentlySelectedTrackIdx).title = qid('edtSongTitle').controlClass.value;
I didn't expect the database field to be updated until I did a commitAsync. I don't want the value saved to the database until they click OK. In case they click cancel, in which case the updated values wouldn't be saved.
To my understanding, editing a field in a shared object WILL instantly update within the UI and the rest of the program, but will not be saved to the
database until commitAsync() is called. (Could be wrong; I'll double check). Either way, I agree that you won't want to edit the track objects until the user clicks OK. One solution would be to store the edited fields inside an array or object, then loop through the array and update the corresponding tracks' fields when the click OK.
MPG wrote: ↑Fri Nov 19, 2021 11:58 am
2) for the spellcheck, I need to include a javascript file. In my js file I have the following:
requirejs('Scripts/spellCheck/dialogs/include');
It doesn't seem to matter how I try to access the file, the call fails. Any suggestions?
If you have a helper script whose name does not yet exist in MediaMonkey (i.e., something other than actions.js, mminit.js, controls/listView.js, etc etc), use localRequirejs. That way, you can guarantee that
your version of the script is loaded, in the case of multiple addons using the same script name. Also, when using requirejs/localRequirejs, don't include the "Scripts/<addon id>/" in the call. MediaMonkey handles that path magic automatically.
So for example, if your script is located in helpers/spellcheck.js, then do localRequirejs('helpers/spellcheck"), not requirejs('Scripts/spellCheck/helpers/spellcheck').
Great!
[quote=MPG post_id=490491 time=1637341093 user_id=14834]
1) I take the value of the textbox and save it to the tracklist using:
trackLst.getValue(currentlySelectedTrackIdx).title = qid('edtSongTitle').controlClass.value;
I didn't expect the database field to be updated until I did a commitAsync. I don't want the value saved to the database until they click OK. In case they click cancel, in which case the updated values wouldn't be saved.
[/quote]
To my understanding, editing a field in a shared object WILL instantly update within the UI and the rest of the program, but will not be saved to the [i]database[/i] until commitAsync() is called. (Could be wrong; I'll double check). Either way, I agree that you won't want to edit the track objects until the user clicks OK. One solution would be to store the edited fields inside an array or object, then loop through the array and update the corresponding tracks' fields when the click OK.
[quote=MPG post_id=490491 time=1637341093 user_id=14834]
2) for the spellcheck, I need to include a javascript file. In my js file I have the following:
requirejs('Scripts/spellCheck/dialogs/include');
It doesn't seem to matter how I try to access the file, the call fails. Any suggestions?
[/quote]
If you have a helper script whose name does not yet exist in MediaMonkey (i.e., something other than actions.js, mminit.js, controls/listView.js, etc etc), use localRequirejs. That way, you can guarantee that [i]your[/i] version of the script is loaded, in the case of multiple addons using the same script name. Also, when using requirejs/localRequirejs, don't include the "Scripts/<addon id>/" in the call. MediaMonkey handles that path magic automatically.
So for example, if your script is located in helpers/spellcheck.js, then do localRequirejs('helpers/spellcheck"), not requirejs('Scripts/spellCheck/helpers/spellcheck').