EasyUI Form 事件流程 |
從原生到三方元件
HTML 原生的 Form 使用上很容易,原本也要採用這樣的設計,但為了界面一致性,採用 EasyUI Textbox 等元件配置,但 EasyUI 元件實際在渲染時會和我們預期配置不同,這也造成上傳時有些要注意的地方。例如設計的 input class="easyui-passwordbox" 就會被拆成兩個 Html 標籤處理:
在網頁復刻應用程式時,第一關面對的是 UI 重建,而最先遇到的就是介面橫幅 (Banner)。
在重建的過程中,難免會把以前的開發套路帶進來,造成時間上的浪費。
要重建橫幅,就要先解構它成為一個個小零件,再重組起來,內容如下:
一共三個元件,我是這麼處理的。
Studying Devart dbExpress driver, readme file for SQL Server :
Users of dbExpress driver for SQL Server with Source Code can embed the driver into the application directly. For information on how to do this refer to Borland documentation.
This sentence mainly explains that Devart company can use certain mechanisms to make the existence of DBX Dll unnecessary when deploying the project, for example: dbexpsda40.dll and so on.
Some DBX Drivers need to install the DB Client, but Devart provides a [Direct Connection] mode, in which the database access components can be directly connected to the DB via TCP without the DB Client. In addition to omitting the conversion of DB Client, there is no need for additional deployment of DBX DLL settings, which can effectively eliminate potential system configuration problems and save time for publishing system configuration.
Although there is no need to deploy DLL, based on the principle of equivalent exchange, the capacity of the DLL will be filled into the EXE we want to deployment, which will cause the execution file to become larger - it grows about 487 Kb.
You need to purchase [version with source code] first, and exchange for knowledge achievements with a small price, I think it is worth it!
After the purchase of the [Include source code version] condition is established, and you only need to add the [DbxSdaDriverLoader] unit to the project, supplemented by the following code, to achieve the goal of [No DBX DLL required]:
uses
Data.DB, Data.SqlExpr, DBXDevartSQLServer, DbxSdaDriverLoader;
...
procedure TForm1.Button1Click(Sender: TObject);
begin
SQLConnection1.DriverName := 'DevartSQLServerDirectBuiltin';
SQLConnection1.LibraryName := 'dbexpsda41.dll';
SQLConnection1.VendorLib := '';
SQLConnection1.GetDriverFunc := 'getSQLDriverSQLServerDirect';
SQLConnection1.Params.Values['OS Authentication'] := 'False';
SQLConnection1.Params.Values['HostName'] := 'Host';
SQLConnection1.Params.Values['User_Name'] := 'sa';
SQLConnection1.Params.Values['Password'] := '';
SQLConnection1.Params.Values['Database'] := 'Database';
SQLConnection1.LoginPrompt := False;
SQLConnection1.Connected := True;
end;
Developers using DBX don’t actually need to rush to replace components. Sometimes spend some cost, can bring more value.
The above information is shared with you!
================================================================
在研究 Devart dbExpress driver for SQL Server 的 Readme 檔案時,我發現了一句古代文字:
Users of dbExpress driver for SQL Server with Source Code can embed the driver into the application directly. For information on how to do this refer to Borland documentation.這句話主要在說明 Devart 它可以利用某些機制,使佈署專案時可以不需要 DBX Dll 的存在,例如:dbexpsda40.dll 等。
有些 DBX Driver 需要安裝 DB Client,但 Devart 提供【直接連接】模式,在此模式下可以讓資料庫存取元件在不用 DB Client 的場合下透過 TCP 直接連接 DB。除了少掉 DB Client 的轉換外,更不需要額外佈署 DBX DLL 的設定,可以有效排除潛在的系統設定問題和節省發佈系統的設定時間。
雖說不用佈署 DLL,但基於等價交換原則,DLL 的容量會填充到我們欲發佈的 EXE 上面,進而造成執行檔變大的情形 -- 大約成長 487 Kb 左右。
方便部署的前提為【購買含原始碼版本】,用少許代價換取知識成果,我認為值得!
在使用前提【購買含原始碼版本】條件成立下,之後只需在專案中加入【DbxSdaDriverLoader】單元,並輔以底下程式碼,便能達成【不需 DBX DLL】的目標:
uses
Data.DB, Data.SqlExpr, DBXDevartSQLServer, DbxSdaDriverLoader;
...
procedure TForm1.Button1Click(Sender: TObject);
begin
SQLConnection1.DriverName := 'DevartSQLServerDirectBuiltin';
SQLConnection1.LibraryName := 'dbexpsda41.dll';
SQLConnection1.VendorLib := '';
SQLConnection1.GetDriverFunc := 'getSQLDriverSQLServerDirect';
SQLConnection1.Params.Values['OS Authentication'] := 'False';
SQLConnection1.Params.Values['HostName'] := 'Host';
SQLConnection1.Params.Values['User_Name'] := 'sa';
SQLConnection1.Params.Values['Password'] := '';
SQLConnection1.Params.Values['Database'] := 'Database';
SQLConnection1.LoginPrompt := False;
SQLConnection1.Connected := True;
end;
使用 DBX 的開發者其實不需要急著更換元件,有時使用更好的 Driver 也能夠達到【花得更少,用得更好】的目標,用少許的金錢所帶來的經濟效益遠超乎想像。
以上資訊和你分享!