A: 

If I understand your problem correctly, I think you just need

<div id="dialog" style="display: none;">

// form here
</div>

so that when the page initially loads, the dialog and form will be hidden until needed.

Edit: and to get the sortable to reload from ajax

if (bValid) {
    $.ajax({
      type: "POST",
      url: "server_items_reorder.php",
      data: 'tid=' + portlet_to_edit + '&title=' + name.val(),
      success: function() { $('.portlet').sortable('refresh'); }
    });
    $(this).dialog('close'); 
}
Rob Van Dam
Thank you Rob ....Dank je wel Rob
wHiTeHaT
I also still try to find a way to update the edited portlet.$('.portlet').sortable('refresh') //not work?
wHiTeHaT
I added a fix for the ajax call, you need to call the `.sortable('refresh')` in a callback of the ajax since otherwise, it will refresh before the ajax call completes (the ajax call happens simultaneously with the actions that come after it). However, from your example code, you're not loading any new items so the refresh won't do anything. What was you expected it to do?
Rob Van Dam
Yes Rob , your right, thank you for clearing this up to me.However the refresh not work with your code.ofcourse i expected that the whole portlet i edited would refresh it's content.
wHiTeHaT
i think i totaly miss it here.sortable('refresh') doesnt work as i think , i think (huh).I fetch the data from the same page as the jquery function , i then expect sortable('refresh') will execute the sql query again, what cant be done couse there's no $.ajax call being executed to re-fetch the sql data?
wHiTeHaT
.sortable('refresh') won't execute the sql query again. All it does is tell jquery about any changes you have manually made to the items in the sortable (like adding or removing). If you want to reload via the sql, you'll need to use an ajax call (you could have the result of server_items_reorder give you that, either as JSON to rebuild the sortable or as raw html).
Rob Van Dam
posseble this is to much asked ,i mostly can help myself when i see something i understand.I used aloth of examples from here to achieve what i currently have.As there's still so much to do to get this application running (donate it to a cms community) , could someone give me an example to the specific need i have.There are 100's pieces of code here what might do the trick , but it is a big big forrest.
wHiTeHaT