andyhill
uniGUI Subscriber-
Posts
1257 -
Joined
-
Last visited
-
Days Won
6
Content Type
Profiles
Forums
Events
Everything posted by andyhill
-
HtmlLib from delphihtmlcomponents.com
-
I build my PDF files at runtime, firstly as HTML Files, then finally converting to PDF so I believe it would be relatively easy to CONCATINATE multiple HTML files before conversion into one PDF.
-
'#toolbar=0' No longer works, also tried '&pagemode=none'. C:\Program Files (x86)\FMSoft\Framework\uniGUI\uni-1.95.0.1577\pdf.js\web\viewer.js has "disablePageMode" set to 'false' in two locations, I changed this to 'true' but it made no difference ? Please provide a way to NOT SHOW THUMBNAILS OF FIRST SHOWING
-
Using Grid.Ext.Events 'validateedit' 'validateedit' Event checks to see if the CurrCol is using a ComboBox editor, if so the Event processes the ComboBox's before and after values A Logic decision is made in code, if required then automatically populating other Grid Cells (on the same row) with new data relating to the new ComboBox value ComboBox Editing is closed <------- this is what your 'reconfigure' Event does now Grid moves on to next cell ALL THIS WORKS USING THE 'reconfigure' Event you gave me earlier. As A Teaching Lesson My additional question was why can't I just use the code below inside the Grid's 'validateedit' Event:- UniSession.AddJS('Ext.defer(function(){'+GridJSName+'.editingPlugin.completeEdit()}, 10);'); instead of relying on the ComboBox's 'reconfigure' Event to close the editor ? Is it a timing issue ?
-
Fantastic - Thank You Sherzod. Is it possible to do this in the Grid's 'validateevent' after verifying it was the CombBox that triggered the 'validateedit' Event:- MyJSName:= MainForm.grdWorkSheet.JSName; UniSession.AddJS('Ext.defer(function(){'+MyJSName+'.editingPlugin.completeEdit()}, 10);'); I tried this but it had no effect ?
-
I have a need where the user can select from a grid's editor combobox an item of interest and then using the 'validateedit' event I fetch and populate the other specific row cell data relating to the selection = live update of SellPrice. The reason why it is not a DBComboBox is the fact that the user is also allowed to type in an item manually even if it does not exist in the combobox list. So if it exists, then SellPrice etc. is automatically updated in the grid, if not exist then user can type in the SellPrice manually. My code works to a point, but fails to advance to the next cell forcing a repaint, only by mouse clicking the next cell (or TAB Key) does the SellPrice display - our focus is stuck within the editors combobox no matter what we do in code - please advise. procedure TMainForm.grdWorkSheetAjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings); ... col:= grdWorkSheet.CurrCol; // 1=Quantity, 2=Description, 3=SellPrice if col = 2 then begin UniMainModule.PreItemDescription:= Trim(Params.Values['old']); UniMainModule.PostItemDescription:= Trim(Params.Values['new']); if ( (UpperCase(UniMainModule.PreItemDescription) <> UpperCase(UniMainModule.PostItemDescription)) and (UniMainModule.PostItemDescription <> '') ) then begin if UniMainModule.tblLkUpItems.Locate('Description', VarArrayOf([Trim(UniMainModule.PostItemDescription)]), [loCaseInsensitive]) = True then begin grdWorkSheet.Columns[2].Field.AsString:= UniMainModule.PostItemDescription; grdWorkSheet.Columns[3].Field.AsFloat:= UniMainModule.tblLkUpItems.FieldByName('SellPrice').AsFloat; grdWorkSheet.Columns[4].Field.AsString:= UniMainModule.tblLkUpItems.FieldByName('BASType').AsString; grdWorkSheet.CurrCol:= grdWorkSheet.CurrCol + 1; grdWorkSheet.Repaint; ValidateBusyFlag:= False; ...
-
Not quite what I am after. This is my JS code to read the Old Data and the Newly Typed Data OR the Newly Selected Combo Data. MyScript:= 'validateedit=function validateedit(editor, context, eOpts) '#10+ '{'#10+ ' n = context.value; '+ ' o = context.record.data[context.field]; '+ ' ajaxRequest(MainForm.grdWorkSheet, ''_ValidateEdit_'', ["new="+n, "old="+o]); '+ '} '; grdWorkSheet.ClientEvents.ExtEvents.Add(MyScript); In my grdWorkSheet _ValidateEdit_ event how can I replace the focused row's store data with the newly typed data and any other computed changes that I may have generated (a lot of logic has taken place inside the _ValidateEdit_ event, now I want the store's data to reflect my approved changes for that row).
-
I need to send back via ajax the focused row, focused colX ([1] or by field name) the cell value - please advise how - thanks. MyScript:= 'validateedit=function validateedit(editor, context, eOpts) '#10+ '{'#10+ ' txt = this.columnManager.columns[1].getEditor().getValue(); '#10+ ' ajaxRequest(MainForm.grdWorkSheet, ''_ValidateEdit_'', ["t="+txt]); '+ '} '; grdWorkSheet.ClientEvents.ExtEvents.Add(MyScript);
-
YES, I only fell for that once. cbLookUpItems: TUniComboBox; ... ////////////////////////////////////////////////////////////////////////////// cbLookUpItems:= TUniComboBox.Create(HiddenPanel); cbLookUpItems.Name:= 'cbLookUpItems'; cbLookUpItems.OnAjaxEvent:= cbLookUpItemsAjaxEvent; // cbLookUpItems.BeginUpdate; cbLookUpItems.Items.Clear; cbLookUpItems.Items.Add(''); if UniMainModule.MyQuery1.Active then UniMainModule.MyQuery1.Close; UniMainModule.MyQuery1.SQL.Clear; UniMainModule.MyQuery1.Params.Clear; UniMainModule.MyQuery1.SQL.Add('SELECT Description '+ 'FROM Items '+ 'WHERE HideFromView <> TRUE '+ 'ORDER BY Description ;'); UniMainModule.MyQuery1.Open; while not UniMainModule.MyQuery1.Eof do begin cbLookUpItems.Items.Add(Trim(UniMainModule.MyQuery1.FieldByName('Description').AsString)); UniMainModule.MyQuery1.Next; end; UniMainModule.MyQuery1.Close; // 209 items added cbLookUpItems.EndUpdate; // cbLookUpItems.OnCloseUp:= cbLookUpItemsCloseUp; cbLookUpItems.OnChange:= cbLookUpItemsChange; cbLookUpItems.OnChangeValue:= cbLookUpItemsChangeValue; //cbLookUpItems.OnSelect:= cbLookUpItemsSelect; // cbLookUpItems.ClientEvents.ExtEvents.Clear; MyScript:= 'beforeselect=function beforeselect(combo, record, index, eOpts)'#13#10 + '{'#13#10 + ' ajaxRequest(MainForm.cbLookUpItems, '#39'_beforeSelect_'#39', []); '#13#10 + '} '; cbLookUpItems.ClientEvents.ExtEvents.Add(MyScript); // MyScript:= 'select=function select(combo, record, eOpts)'#13#10 + '{'#13#10 + ' ajaxRequest(MainForm.cbLookUpItems, '#39'_Select_'#39', ["r="+record]); '#13#10 + '} '; cbLookUpItems.ClientEvents.ExtEvents.Add(MyScript); ALL EVENTS SHOW TEXT '' ITEMINDEX 0
-
IDE fine, runtime creation ISSUE (even though events all fire) so need to pass TEXT SELECTION back in Params below MyScript:= 'select=function select(combo, record, eOpts)'#13#10 + '{'#13#10 + ' ajaxRequest(MainForm.cbLookUpItems, '#39'_Select_'#39', ["r="+record]); '#13#10 + PLEASE SHOW HOW TO SET CHOSEN DATA IN PARAM '} '; cbLookUpItems.ClientEvents.ExtEvents.Add(MyScript);
-
I am creating cbLookUpItems (as a grid editor) complete with data (showing when dropdown) and all events are firing. cbLookUpItems.OnChange:= cbLookUpItemsChange; (cbLookUpItems.Text always shows '' in events) cbLookUpItems.OnSelect:= cbLookUpItemsSelect; (cbLookUpItems.ItemIndex always 0) So added my own event MyScript:= 'select=function select(combo, record, eOpts)'#13#10 + '{'#13#10 + ' ajaxRequest(MainForm.cbLookUpItems, '#39'_Select_'#39', ["r="+record]); '#13#10 + PLEASE SHOW HOW TO SET CHOSEN DATA IN PARAM '} '; cbLookUpItems.ClientEvents.ExtEvents.Add(MyScript); SAME cbLookUpItems.Text always shows '' in events cbLookUpItems.ItemIndex always 0 Even added defer between change and select. Please advise - thanks