Hello,
I have a screen with a couple of TreeGrid components and a MenuTab component. I am trying to open a Modal Window loaded with a local file. I used window.setSrc(“xyz.html”) after using the code in the demos. Here’s my complete code (called from onClick in a MenuTab):
isc.Window.create({
ID: "modalWindow",
title: "Modal Window",
autoSize:true,
width:800,
height: 600,
autoCenter: true,
isModal: true,
autoDraw: true,
closeClick : function () {}
});
modalWindow.centerInPage();
modalWindow.setSrc("xyz.htm");
modalWindow.show();
Somehow, the modal window does appear at right size, but the loaded content (xyz.html) only displays in about 1/10th of the screen at the top. How do I make the content in xyz.html appear in the full window? There must be a property that I can set to make this happen (I just can’t find it).
thanks in advance.
Hi NinadTambe,
Try setting the src attribute when you construct the window instead of calling setSrc():
isc.Window.create({
src: "xyz.htm",
...
If that doesn’t fix it, can you show the contents of xyz.htm?
Doesn’t fix it, unfortunately..
I tried this, but it is still the same issue. Basically, I get 1/5th or less of the screen with scrollbars and the content of xyz.htm loaded in it (can barely see couple of lines with every scroll). Now, if you mean by showing contents of xyz.htm inline (i am assuming that’s what you mean) within the main screen, I cannot really do that. The xyz.htm is too big and there will actually be xyz.htm or some other .htm based on what the user selects in the main screen.
Hope this helps.
thanks.
Hi Ninad,
There are numerous examples of Window.src functioning as designed within the SDK, so we can’t really help further until we can see what you’ve got in “xyz.htm”. If it’s too large to post, send it to support@isomorphic.com.
Here’s the file…
<html>
<head>
<SCRIPT>
window.isc_useSimpleNames = false;
var isomorphicDir="scripts/isomorphic/";</SCRIPT>
<SCRIPT SRC=scripts/isomorphic/system/modules/ISC_Core.js></SCRIPT>
<SCRIPT SRC=scripts/isomorphic/system/modules/ISC_Foundation.js></SCRIPT>
<SCRIPT SRC=scripts/isomorphic/system/modules/ISC_Containers.js></SCRIPT>
<SCRIPT SRC=scripts/isomorphic/system/modules/ISC_Grids.js></SCRIPT>
<SCRIPT SRC=scripts/isomorphic/system/modules/ISC_Forms.js></SCRIPT>
<SCRIPT SRC=scripts/isomorphic/system/modules/ISC_DataBinding.js></SCRIPT>
<SCRIPT SRC=scripts/isomorphic/skins/SmartClient/load_skin.js></SCRIPT>
</head>
<body>
<script>
<!--
isc.defineClass("DragPiece", "Img").addProperties({
width:48, height:48,
layoutAlign:"center",
canDragReposition:true,
canDrop:true,
dragAppearance:"target",
appImgDir:"pieces/16/"
})
isc.VStack.create({
showEdges:true, edgeImage:"lpShortDot.png",
membersMargin:10, layoutMargin:10,
canAcceptDrop:true,
animateMembers:true,
dropLineThickness:6,
dropLineProperties:{backgroundColor:"#40c040"},
members:[
isc.DragPiece.create({src:"FolderIcon.jpg"}),
isc.DragPiece.create({src:"Image-Icon-Pallette.jpg"})
]
})
isc.HStack.create({
left:120,
showEdges:true, edgeImage:"topLine.jpg",
membersMargin:10, layoutMargin:10,
canAcceptDrop:true,
animateMembers:true,
showDragPlaceHolder:true,
placeHolderProperties:{border:"1px solid #4040ff"},
members:[
isc.DragPiece.create({src:"Image-Icon-Pallette-Assigned.jpg"}),
isc.DragPiece.create({src:"PersonIcon-Audiences.jpg"})
]
})
// -->
</script>
</body>
</html>
This looks like you’re loading all of SmartClient and some components in an IFRAME in a modal window - is that accurate?
If you want to show SmartClient components inside the window, you can just add them to the Window via the items property (documented here: http://www.smartclient.com/docs/5.7.1/a/b/c/go.html#attr..Window.items). You can do this dynamically on the page without loading the components from a different URL.
If you do want to load those components from a different URL, I suggest creating a ViewLoader and adding it to Window.items. Docs here: http://www.smartclient.com/docs/5.7.1/a/b/c/go.html#class..ViewLoader
While it is possible to load an IFRAME with SmartClient in it, we recommend against that approach because IFRAMEs have many problems, differing by browser: they leak memory unless cleaned up properly and can have unexpected caching behavior and unexpected interactions with the back/forward browser buttons.
Tried that, but missing something…
I added the window.addItem method instead of calling window.setSrc(). But the modal window opens and it is totally blank. I am providing the name of a smartclient component that I included in the main page (copied it from Testing3.htm).
isc.Window.create({
ID: "modalWindow",
title: "Modal Window",
autoSize:true,
width:400,
height: 300,
// contentLayout: "vertical",
autoCenter: true,
isModal: true,
// autoDraw: true,
closeClick : function () {}
});
// modalWindow.centerInPage();
// modalWindow.setSrc("Testing3.htm");
// modalWindow.addItem(VStackAdd);
modalWindow.addItem(DragPiece);
// isc.AvailableSitePages.openAll();
modalWindow.show();
My Fault…
Actually, it seems like I can only pass a component that can redraw itself (TreeGrid etc.). So, I cannot pass a tree, but can pass a treegrid. Also, I had to remember to do autodraw:false on the component being displayed inside the modal dialog. thanks for your help.
I had another question though. How do I set customIconProperty on nodes of TreeGrid. The documentation says “Set node[grid.customIconProperty] to the URL of the desired icon”, but what is the exact format in the code? Is it a property in TreeNode element with gridname.customIconProperty?
thanks a lot.
Hi Ninad,
The default value for treeGrid.customIconProperty is “icon”. So, set node.icon to the path to the image you want to use.