Rank: Advanced Member
Groups: Member
Joined: 3/20/2018(UTC) Posts: 61
Thanks: 4 times
|
hi, HOW ARE YOU, i'm trying save my custom design under name instead of stateId. Can i have a code exemple for that. let's see my code, i don't know where i have to add line to add custom name. Code://Saving the product.
$("#editorPage #saveButton").click(function () {
//Saving a product to the StateFileName.st file.
//editor.saveProduct("StateFileName")
editor.saveProduct()
//If the product has been successfully saved.
.then(function (result) {
//Saving the product state info.
saveData = result;
hiResOutputUrls = result.hiResOutputUrls;
proofImageUrls = result.proofImageUrls;
stateId = result.stateId;
returnToEditUrl = result.returnToEditUrl;
boundsData = result.boundsData;
userChanges = result.userChanges;
StateFileName= result.StateFileName;
console.log("User " + userId + " successfully saved state " + stateId);
//The user identifier.
userId = result.userId;
//saving in Database
alert(saveData.stateId+" "+result.proofImageUrls+" "+result.userChanges+" "+result.returnToEditUrl+" "+saveData.userId+" "+$('div#test', window.parent.document).text());
$.ajax({
url: "http://www.rapidct/connect2.php",
data: { stateid: saveData.stateId, ccusersid:saveData.userId, returnToEditUrl:result.returnToEditUrl, userid:$('div#test', window.parent.document).text()},
type: "POST",
context: document.body
}).done(function() {
// your code goes here
});
THANKS Edited by moderator Wednesday, April 18, 2018 10:31:53 PM(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member
Groups: Joined: 7/4/2017(UTC) Posts: 43
Was thanked: 12 time(s) in 12 post(s)
|
Hi Ben, This string is correct (it is commented in your code now): Code://Saving a product to the StateFileName.st file.
editor.saveProduct("StateFileName");
Resulting state ID will the same as StateFileName. Regards, Andrew Edited by user Wednesday, April 18, 2018 10:32:23 PM(UTC)
| Reason: Not specified
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.