CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

Exception SOpt

by feland » 01 Mar 2017 18:02

Hi,
when i add my column dinamically to my jqgrid and set col.SearchOptions.SOpt to ... my webapplication show the exception:

SetConversion undefined in "TIWCGJQGridColSearchOptions.ConvertSetToString" for property "SOpt"!

Following i post the code that i used to create the JQgridcolumns:

Code: Select all
 
var
      col: TIWCGJQGridCol;
begin
    slCol := TStringList.Create;
    slCol.Delimiter := ';';
    slCol.StrictDelimiter := true;
    slCol.DelimitedText := sIntestazione;

    while (i < slCol.Count) do
    begin
      sFieldName := slCol[i];

      col := JQGridReport.JQGridOptions.ColModel.Add;
      col.Name := sFieldName;
      col.Idx := sFieldName;
      col.Caption := StringReplace(sFieldName, '_', ' ', [rfReplaceAll]);;
      col.Editable := false;
      col.Formatter := gcfNone;

      col.SearchOptions.SOpt:=[gsoEqual, gsoNotEqual, gsoBeginWith, gsoDoesntBegin, gsoIsIn, gsoIsNotIn, gsoEndsWith, gsoDoesntEndsWith,  gsoContains, gsoDoesntContain, gsoLessEqual,gsoGreatEqual];

      col.Search := true;
      col.Sortable := true;

      inc(i);
    end;
end;


On attachment the Exception screen that I show.
Can you help me?

Thanks,
feland
You do not have the required permissions to view the files attached to this post.
feland
 
Posts: 89
Joined: 15 Jun 2015 15:12

by feland » 07 Mar 2017 13:53

The request is urgent please.
feland
 
Posts: 89
Joined: 15 Jun 2015 15:12

by Alexander Bulei » 07 Mar 2017 15:05

Hi feland,

When you call that code?

Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by feland » 07 Mar 2017 18:19

OnCellSelectEvent.
I create that columns to a second JqGrid that is empty without columns.
If I comment the line
Code: Select all
    col.SearchOptions.SOpt:=[gsoEqual, gsoNotEqual, gsoBeginWith, gsoDoesntBegin, gsoIsIn, gsoIsNotIn, gsoEndsWith, gsoDoesntEndsWith,  gsoContains, gsoDoesntContain, gsoLessEqual,gsoGreatEqual];
it works correctly but I don't view the operator LessEqual, GreatEqual.

Help me please. :roll:
feland
 
Posts: 89
Joined: 15 Jun 2015 15:12

by Jorge Sousa » 07 Mar 2017 19:06

Hello

I'm afraid that code will not work in the event OnCellSelectEvent

Because .jqgrid doesn't support SOpt to be changed on the fly with javascript.

You will have to find a way to do the same at create time,

or

using grid.ajaxrenreder which re-renders the whole grid again.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by feland » 08 Mar 2017 16:19

Thank you so much,
using the event ajaxrerender it works correctly. ;)
feland
 
Posts: 89
Joined: 15 Jun 2015 15:12

by feland » 14 Mar 2017 14:15

Hi,
on grid.ajaxrerender event I set that code:
Code: Select all
       formatOptionDateTime := TIWCGJQGridColFormatOptionsDateTime.Create(nil);
        formatOptionDateTime.SrcFormat := 'Y-m-d h:i:s';
        formatOptionDateTime.NewFormat := 'd/m/Y h:i:s';
        formatOptionDateTime.NewFormatDelphi := 'dd/mm/yyyy hh:nn:ss';
        gridAggiornamenti.JQGridOptions.ColModel[0].FormatOptions := formatOptionDateTime;
        formatOptionDateTime.Free;


but when i recreate my grid column ,its format is 'yyyy-mm-dd hh:nn:ss'.
How Can I set the format correctly?

Thanks,
feland
feland
 
Posts: 89
Joined: 15 Jun 2015 15:12

by Jorge Sousa » 14 Mar 2017 16:14

Hi

Just set NewFormatDelphi

never change SrcFormat

and NewFormat is changed internally by setting NewFormatDelphi
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by feland » 15 Mar 2017 11:53

Thanks, it work. :D
feland
 
Posts: 89
Joined: 15 Jun 2015 15:12


Return to JQGrid

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.