Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
benadams  
#1 Posted : Wednesday, April 18, 2018 4:08:53 PM(UTC)
benadams

Rank: Newbie

Groups: Member
Joined: 3/20/2018(UTC)
Posts: 4

Thanks: 1 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

Andrey Semenov  
#2 Posted : Wednesday, April 18, 2018 10:29:50 PM(UTC)
Andrey Semenov

Rank: Advanced Member

Groups: Member, Administration
Joined: 7/4/2017(UTC)
Posts: 33

Was thanked: 10 time(s) in 10 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

Users browsing this topic
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.