mazluta Posted August 25, 2021 Share Posted August 25, 2021 hi, i search the form for "color part grid" i want to paint part of text in the value of the grid cell. instead of filtering record i want to iterate on all the records in the table (witch is in-memory table) - no more then 100 record per session and if i found the text in the value i want to paint just this part (when ever it exists in the value) so, the user can see in what records the value he look for exists and select the record with checkbox. i found some JS code using mark.js regard to memo component, but how can i implement this on the grid cell? This work, but paint all the cell. if pos(edFiltertxt.Text,Column.Field.AsString) > 0 then begin Attribs.Style.Style := 'background-color: yellow;'; end i want to paint PART of the cell with UniDBGrid1.JSInterface.JSCode( '$('+ UniDBGrid1.JSName +'.getDoc().mark("'+edFiltertxt.Text+'",{});'); any idea? Quote Link to comment Share on other sites More sharing options...
mazluta Posted August 26, 2021 Author Share Posted August 26, 2021 this done with and in - DynMezaheGrid DrawColumnCell and the result .... the col field with the value is yellow. i want JUST the value to get the color is that possible? Any MASTER that can solve that mysteries thing ? Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted August 27, 2021 Share Posted August 27, 2021 12 hours ago, mazluta said: this done with and in - DynMezaheGrid DrawColumnCell and the result .... the col field with the value is yellow. i want JUST the value to get the color is that possible? Any MASTER that can solve that mysteries thing ? Hello, Instead of adding background color, you need to change the record in the grid like below Uni<span style="color:red">GUI</span> Quote Link to comment Share on other sites More sharing options...
mazluta Posted August 28, 2021 Author Share Posted August 28, 2021 Hi Hayri, thanks for the answer, i have a grid with 25 records - all have different text in them - it's dynamic data... that grid have 5 column, i can search by any column, the data is loaded from table, each user have it's on data. can you give me some code example - not just idea.. Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted August 28, 2021 Share Posted August 28, 2021 2 hours ago, mazluta said: Hi Hayri, thanks for the answer, i have a grid with 25 records - all have different text in them - it's dynamic data... that grid have 5 column, i can search by any column, the data is loaded from table, each user have it's on data. can you give me some code example - not just idea.. Hello Please create a test case so I can work on it Quote Link to comment Share on other sites More sharing options...
mazluta Posted August 31, 2021 Author Share Posted August 31, 2021 hi, I back. please see the rar attach. run the program, on the name filter field type - r (just the char "r") all the line with the "r" in value of the field - become - yellow. now --- type "a" (the char "a" - so you have "ra" in the filter field) now - just the records with the "ra" in the value - become - yellow. this help the user - to see - in what records the value exists (it good for small tables.... but good for me in the search lookup tables). BUT - i want just the "ra" inside the field value become - yellow not all the field.... yossi ColorGrid.rar 1 Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted September 1, 2021 Share Posted September 1, 2021 15 hours ago, mazluta said: hi, I back. please see the rar attach. run the program, on the name filter field type - r (just the char "r") all the line with the "r" in value of the field - become - yellow. now --- type "a" (the char "a" - so you have "ra" in the filter field) now - just the records with the "ra" in the value - become - yellow. this help the user - to see - in what records the value exists (it good for small tables.... but good for me in the search lookup tables). BUT - i want just the "ra" inside the field value become - yellow not all the field.... yossi ColorGrid.rar 59.41 kB · 1 download Hello Please find the attached modified example. highlight.zip 1 Quote Link to comment Share on other sites More sharing options...
mazluta Posted September 1, 2021 Author Share Posted September 1, 2021 looking nice. i will check it Quote Link to comment Share on other sites More sharing options...
mazluta Posted September 1, 2021 Author Share Posted September 1, 2021 by the way how did you do this? Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted September 1, 2021 Share Posted September 1, 2021 1 hour ago, mazluta said: by the way how did you do this? Quote Link to comment Share on other sites More sharing options...
mazluta Posted September 1, 2021 Author Share Posted September 1, 2021 okkkk good work. where dinosaur like me can learn about those tricks in ext.js where are documents about this function and how they influence ? =============== JSAssign('getColumns()[1].renderer', [JSFunction('value, metaData, record, rowIndex, colIndex, store, view', 'internalRender(value, metaData, record, rowIndex, colIndex, store, view);'+ 'return value.replaceAll('+edName.JSName+'.value, "<span style=''background-color: yellow;''>" + '+edName.JSName+'.value + "</span>"); ' )]) ================ this put permanent function in the client DOM? and ================== JSAddListener('change', JSFunction('', tstGrid.JSName+'.getView().refresh();')) ================== like KeyPress in the DOM? ++++++++++++++++++ because the UniFormAfterShow occure only one time at the start Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.