Numerous problems on various categories

What I’m trying to achieve …
A windowing system that updates various tables (customers, sites, etc…)
windows are opened inside a one pane layout that takes up the whole browser window, and has the main menu.
The windows consist of a 2E layout, 1st cell contains the table,and 2nd cell contains the details of the record. I want the window to open with the list visible ( cell(“a”) is grid, cell(“b”) is form.
I use:
sediLayout.cells(“a”).hideHeader();
sediLayout.cells(“b”).hideHeader();
sediLayout.cells(“b”).collapse();
sediLayout.cells(“a”).expand();
However I still get a grey border at the bottom of the window where the header of cell(“b”) would like to be (if I hover over it I get a “b”). Doubleclicking on an entry, I get the cell(“a”) to collapse and cell(“b”) to expand, but this time cell(“b”) has the grey border at the top, where the cell(“a”) header would be.

Can I get these to dissapear completely? Basically the window either contains a table, or a form according to whether you’re looking at the list, or at the details of an entry.

I put a toolbar in the first cell (table one)…
Where ARE the Icons that you have in your example for New, print, etc?? they’re NOT in the imgs folder!

I tried putting a tabbar in cell(“b”) so I can split details in more forms on more tabs, but nomatter now I try with “.cells(“b”).autoSize()”, enableAutoSize, enableAutoResize, when I double-click on the table, and that layout cell collapses and the form(now tabbar) cell expands, I can see a little horizontal scrollbar at the top of the tab window, but nome of the window contents! either the form or the tabbar are NOT resizing!

Another problem/query: on your excellent tutorial at “Start DHTMLX Docs”, you use a popup form to enter new data. I’ve got a “new” button on the table cell, which, like double-clicking on an entry, makes the tabel cell collapse, and the form one expand, and therefore I recycle the same form for new entries. By shotgun programming I’ve got it to work, but I don’t think it’s optimal (see enclosed code).

Last (simplest) problem: I’ve got a login form. I wanted to submit with the enter key. I read somewhere that there’s an updated form with an onKeyUp event. I’m using the single “dhtmlx.js” and not the component by component includes. can I update or something?

Hope this has NOT tested your patience tooo far… I only discovered you a few months back, and I’ve knocked up a prototype for a customer. He see’s what he likes, and therefore I’m going to make him “foot the bill” for the full version, as soon as I’ve really got something to show-off.

Lastly, my complients, Good work!
testSediTab.rar (2.51 KB)

Q1:
You don’t need to collapse/expand your cells. There is a views-mode in the layout. Please, see the sample:
dhtmlx.com/docs/products/dht … views.html
Use '1C ’ pattern - your cell will be correctly builtю And use VIEW to change your a/b views.

Q2:
These icons you can find in your suit in dhtmlxToolbar folder:
…/dhtmlxToolbar/samples/common/imgs/
If you haven’t any - dounload from the Standard Edition for free:
dhtmlx.com/x/download/regula … oolbar.zip

Q3:
I think if you use view mode - this question will lose an urgencyю If not - will discuss it.

Q4:
Using same form is better than to build it again & again.

Q5:
Download these files and include them in the library after your dhtmlx.js and dhtmlx.css files
download/file.php?id=4778
There are form with an onKeyUp event and more useful fixed files. Not ofisial, but for use.

Darya as usual you are a weath of knowledge!

As you predicted using views is the best option and solved the problem. Now however I have a serious “windowing” problem. As I explained the web page opens with a single 1C layout with menu. The menu opens windows with different functions (usual stuff, customers, suppliers, stock, etc).

I have two problems though (i have attached a VERY simplified verison of the code). The problem is that if I just create a window, I can close it, reopen it, etc… If instead I create a window and put a layout in it then the main “wins” object becomes null, and no more windows can be created. The real program is obviously more complicated and the layouts (as you taught me) contain grids and forms, etc on the various “views”. All I can think of is that if you close a window with other elements attached to it, for some reason it kills the main “win” object common to all windows.

Also How can I avoid re-opening a window that is already on screen ? At the moment every time I click on lets say “win 1”, it opens a new instance of win1.

eg:

var wins;
dhtmlxEvent(window,“load”,function() {
var mainLayout = new dhtmlXLayoutObject(document.body,“1C”);
mainLayout.cells(“a”).hideHeader();
wins = new dhtmlXWindows();
wins.enableAutoViewport(false);
wins.attachViewportTo(mainLayout.cells(“a”));
wins.setImagePath("./dhtmlx/imgs/");
menu = mainLayout.attachMenu();
menu.setIconsPath("./icons/");
menu.addNewSibling(null, “wTop”, “Windows”, false);
menu.addNewChild(“wTop”, 1, “win1”, “Window 1”, false);
menu.addNewChild(“wTop”, 2, “win2”, “Window 2”, false);
menu.addNewChild(“wTop”, 3, “win3”, “Window 3”, false);
menu.attachEvent(“onClick”, function(id) {
switch (id) {
case “win1” : makeWin (1); break;
case “win2” : makeWin (2); break;
case “win3” : makeWin (3); break;
}
});
});

function makeWin (wn) {
var winName = “win” + wn;
var win = wins.createWindow(winName, wn * 10, wn * 10, 400, 300);
win.setText(winName );
// IF I COMMENT THE FOLLOWING LINE ALL WORKS FINE
// OTHERWISE the “wins” object dies when closing window…
lay = new dhtmlXLayoutObject(win,“1C”);
}

When you close the window - all the content is destroyed.
I think that your way out ща the issue id HIDING, not closing your windows.
Please, see my attachment
window_close.rar (30.4 KB)

Thank you as usual. My problems is that is i Dont create a layout inside tge window (which is a child of my wins object) then all works fine. I can close, reopen, open other windows, etc.
Instead if inside the window i create a laout object, when i close the window the parent object wins gets destroyed!!

If you close/delete/unload any/all of windows - object dhtmlXWindows can’t be destroyed.
But all object are attached to any window WILL be destroyed.
What is why i’ve attached my sample to you: hiding window onClose.
Try to modify my sample - attach a layout instead of my blue div and try it.

Fine, thanks. I solved it in a slightly different way: Instead of explicitly creating a wins object
wins = new dhtmlXWindows();
and using that as the parent to the forms,
I use “mainLayout.dhxWins”
Now it all works!

This, instead is a bug I think:
I needed to put both a form and a grid in the same layout. I dug around and I created a containerDiv, with two divs (one for form and one for grid) inside:

and attached the main div to the layout:

prevNewLayout.cells(“a”).attachObject(“divMain”);

However, on the form, everything is ok EXCEPT for the calendar control which won’t appear!

Exactly the same form, simply attached to the layout works fine.

Can you explain, pls?

  1. Firstly i would recommend you use a 2E layout instead of your div-structure aтв attach your grid & form there. If you don’t do it, you can face a problem with displaying these components (especially at resizing).

  2. Secondly recommend you download and replace files are attached.
    new.rar (28.6 KB)

Thanks will try immediately…
Thank u as always!

OK, I included the new files you sent me and THAT’s THE PROBLEM!

IF you include the new “dhtmlxform.js”, Which I already had because it has the onEnter event, then calendars DON’T appear. If you don’t include it then calendars work BUT you lose the onEnter event.

“To be or not to be …”

Can you describe, what do you do to call event ‘onEnter’? Because our calendar & form haven’t this event.
What i need to do to reproduce the issue? Can you give an example,

Sorry, it was the “onKeyUp” event… I use it to detect the enter key:

loginForm.attachEvent("onKeyUp", function (id, value) {
   if (value.keyCode == 13) {
	   doit(this,loginWin);
   }
});

Earlier on in this post, you kindly sent me a “dhtmlxform.js” that has this event, but it stops calendars from appearing. You’d warned me it was a non-official form, at this is obviously a bug in it.

Hi
I can’t reproduce the issue. Please, see my sample - event arises…
form_onkey.rar (29.4 KB)

Yes, No problem with the event, but with the new form the calendar doesn’t work !
see your example, modified
CalendarNotWorking.rar (42.3 KB)

Sorry, but i can’t reproduce the issue. Corrected your sample a little - everything works. But it seems to me that you didn’t include the dhtmlxform_item_calendar.js file

See attached demo
CalendarNotWorking.rar (52.8 KB)

Thank for sharing this information

The main problem with the calendar is it’s authentication process. Even if you implement your own “authentication code” (for example I wish to ALLOW empty dates),

so I put :

validate:function(k){return(ckDateValid(k));}

in the form, and the ckDateValid function is:

function ckDateValid(k) {
if (k==null)
return(true);
else
return (k.toString() != “Invalid Date”);
}

… this does NOT work because If I lease it empty or if I manually type 1/2/2012 instead of 01/02/2012 or even “rubbish” in the date field, the above check ALWAYS comes up with k==NULL

Also is there ANY way to access the calendar’s text part (so that I can somehow check the dates more intelligently and correct them, i.e. 1/2/12 -> 01/02/2012, in code ?