Jump to content

davide

uniGUI Subscriber
  • Posts

    11
  • Joined

  • Last visited

Recent Profile Visitors

519 profile views

davide's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. So i need to create new datamodule with a declaration of DB object (a copy) of uniGUI DB controls presents in mainmodule? i can not do something like that (instantiate a private copy) procedure servermodule.MyTimerTimer(Sender TObject); var local_module: tunimainmodule; begin ... local_module := tunimainmodule.create(nil); local_module.myConnectionObject.connect; ... end; My seconde idea is to send a post message with parameters to server, using wget or curl command, to create a session...is this feasible? my test is blocked by first responce of the server to the curl call. The server responde with 'loading ...' page (message from servermodule while loading first classes), and session is closed by client. I'm looking for a way to get that goal , beacause i'm editing an existing project, with articulate units. Refactoring of simply duplicate some uints in order to call 2 function (that i need in timer event) seems to be so expensive. But there aren't an other way i should quickly start to code tks, Davide
  2. hi everyone, to day i come back to this feature. I've just test thread timer with log message succesfully. I create the object into servermodule and set Enabled to True in create event of servermodule, so i can log current time every some second. (like this) My problem is the same of previus message: I need to use object declared into mainmodule and into formmain (connection, querys and 2 o more function). How can i access from mytimerTimer() procedure in servermodule, to that objects? PS: following execution in debug i have seen a function from UniGuiSession or uniApplication like initApplication, that (i think) was run after http request and session generation, My hope is to be able to run the same code that was runned inside the inizialization of a session, or simulate a session instead. thanks in advantege for your help. Davide
  3. Hello, I've just create a TuniThreadTimer in my servermodule in order to generate serverside procedure, interval lunched. First question is about the place into put that timer, is the servermodule the right place? ( i suppose this is the place where run somthing detached from the users sessions). If the first question's answare is "yes, it is right", how can i access object designed in the mainmodule ? I suppose to use the objects declared in the mainmodule, like connections and querys, to perform my goals. Also instanziate a mainform or other unit to re-use the object declared inside and their own procedure. It is all possible, or part of , or there is a way to simulate a session to use all declared classes? Evenif what is the right design pattern to perform actions in server-side detached from users session with timer event? thanks, Davide
  4. ok , i've just added my e-mail into the customer portal. (my CTO have bought the license) @FarshadMohajeri: i'm developopig over a platform that was alredy developed by some one else. that person also have incloude some delphi classes that work for desktop application, so I can not rewrite all the web application. @DelphiDeveloper: unfortunately is to strong to replicate the behavior in a new sample project, I try to do that tomorrow, I think there are to layer, classes and sublasses, to replicate and simplify. However i think I've found solution: putting the following code to call event from AfterShow event of mainform and on the call backfunction from the other form (that is opened over the mainform, so the unicaldar are not redraw automatically): UniSession.AddJS( 'var bound = '+uniCalendar1.JSName + '.getActiveView().getViewBounds();'+ uniCalendar1.JSName + '.fireEvent(''DateChange'','+uniCalendar1.JSName + ', '+uniCalendar1.JSName + '.getActiveView().getStartDate( ), bound.start, bound.end);' ); It seems to work, having some diffcult on callback function...come back soon to give you the response. Davide
  5. the login form is rendered "over the main form" so beforerender/render/afterrender are all fired before login is confrmed. When the mainform (with calendar panel of course) is showed whitout re-firing render's family event, I'm not able to explane better .... i'm put an alert on beforerender, the message appear during Loading (with uni square icon) , before aniting is showed. I try to use active event, but this event is fired to many time and slowly down the real rendering of the form. tks Davide
  6. Hello Farshad, this is the code in the Demo, for the delete note button: procedure TUniTreeViewUniTreeView.UniButton2Click(Sender: TObject); begin FreeAndNil(SelectedNode); UniLabel2.Caption:='Selected Node: '; end; I do not need to delete a node, but only filter the objects in the treeview and show again in according with the filter string (or clear filter function). I mean is different to show/hide item or delete that. @DelphiDevelper: I try your solution, that work well for other breanch of the tree, but if click on the same branche the icon change (collaps like) but the item inside remain "showed". When click again the node change (expanded icon) and item are doubled. Very strange behavior. I'm not able to disable click (which one to collapse/expande node). Well, i see an other solution on js treeview: some one make a "backup" array (equal to the starting one) and use the Farshad's solution,deleting nodes not responding to the filter string. And before change filter, restore the array with "backup". Farshad do you mean that ? I thinking about performace on clients: do you thik is better use only JS scripting to perform filtering, with out interaction with delphi server side? thanks in advance, regards Davide
  7. ok guys, I find the way to explore js element ed find the right element to hide: if (key = vk_return) then for i := 0 to uniTreeView1.items.count - 1 do begin // check is a leap if not uniTreeView1.items[i].HasChildren then begin // check the text contenct if Pos(UpperCase(uniEdit1.text) , UpperCase(uniTreeView1.items[i].text) ) > 0 then begin // show item/node js_command := js_command + sLineBreak + 'Ext.get('+uniTreeView1.JSName+'.view.getNodeById('+IntToStr(i)+')).setDisplayed(''table-row'');'; uniTreeView1.items[i].Visible := True; end else // hide item/node js_command := js_command + sLineBreak + 'Ext.get('+uniTreeView1.JSName+'.view.getNodeById('+IntToStr(i)+')).setDisplayed(''none'');'; uniTreeView1.items[i].Visible := False; end; // apply js command UniSession.AddJS(js_command); end; Now the nodes are correctly hide , but when i collapse a brunch and re-expand that, the tree is re-redered and the nodes are displyed again! how can i block the event on the unitreeview? the onclick or ondblclick event on delphi side is fired after the real collapse event on the clientside! Davide
  8. Hi, new day, new question: my porpouse is to use a edit field (TuniEdit) to filter the TuniTreeView, showing only the leap of the tree matching the text content of TuniEdit. I use following code into onKeyDown event of Tuniedit: if (key = vk_return) then for i := 0 to uniTreeView1.items.count - 1 do begin // check is a leap if not uniTreeView1.items[i].HasChildren then begin // check the text contenct if Pos(UpperCase(uniEdit1.text) , UpperCase(uniTreeView1.items[i].text) ) > 0 then begin // show item/node uniTreeView1.items[i].Visible := True; end else // hide item/node uniTreeView1.items[i].Visible := False; end; end; Obviusly the code is correct, but it is server side, so my tree html object is not affected! How can i do that client side? I found an example for extjs where the guy use setDisplayed('none'); method of the node to hide the node, but i don't know how to identify the current node (like nameJS) in my for cycle. If I know the js name/identifyer of a single node, I can use unisession.addjss inside the for cycle to set displayed property. I think is the right way to do that, evenif i hope some one can help me to find the right way. Davide PS: in order to implement the example i have linked before, there is some place in unigui object where define the filterby function, like Ext.define(...) in extJs code ?
  9. Hello everyone, i'm in trouble with personalization of client graphic issue of uniCalendarPanel. After some studing of js, extj and js-client-event, i have reached the goal of assign some new class to day cell of the calendar on the event datachange of the calendarpanel object. So i can change month in monthview and the event DateChange make the right work. My problem occur after login and after coming back to the calendar pannel after validation of an other form. In these two cases i need to fireup the event manually. I can't figure how to implement this beaviour. I think the correct js code is <my unicalendarpanel object identifyer>.fireEvent('DateChange', myStartDate, myStartWiewDate, myEndWiewDate); i can use it in a UniSession.addJS or in client-event to run the command, but can't find the correct moment to do that. During the login the mainform of the app is just redered and the code in DateChange event is just runned. After login when the mainform and unicalendarpanel object are shown at the client screen, the graphic is re-redered, but no event is fired (at list i beleave that or can't find that). thanks a lot, and sorry for my bad english. Davide
  10. hi mohammad, i try to personalize nav panel, without success. I'm trying to add "toDay" button and "jump to" section. I've just added some code to ClientEvents->UniEvents on beforeInit: function beforeInit(sender, config) { config.monthViewCfg = { // disable drug and drop enableDD: false, // show day of week on column header showHeader: true , // starting week with Mondey startDay : 1 } } That code working well, but now (in according with specification at the site's you are post before) i would add fetature to "jump to" and "today" with the following config property of CalendarPanel. // nav bar, day feature showNavToday : true, showNavJump : true, It's not running. How do you have solved your first question? thanks in advantage, Davide
×
×
  • Create New...