<commit_before>% Nitrogen Elements Examples
% Copyright (c) 2013 <NAME> (<EMAIL>)
% See MIT-LICENSE for licensing information.

-module(grid).

-include_lib("nitrogen_elements/include/nitrogen_elements.hrl").
-compile(export_all).

body() ->

    %% wf:wire(jqgrid, #jqgrid_event{type = ?ONSELECTROW, postback = jqgrid }),
    %% wf:wire(jqgrid, #jqgrid_event{type = ?ONSELECTROW, event_name="myEvent"}),
    %% wf:wire(jqgrid, #jqgrid_event{type = ?ONCELLSELECT, event_name="myEvent"}),

    [
	#jqgrid{
	    id = jqgrid,
	    options=[
		{url, 'get_jqgrid_data'},
		{datatype, <<"json">>},
		{colNames, ['ID', 'Name', 'Values']},
		{colModel, [
		    [{name, 'id'}, {index, 'id'}, {width, 55}],
		    [{name, 'name'}, {index, 'name1'}, {width, 80}],
		    [{name, 'values1'}, {index, 'values1'}, {width, 100}]
		]},
		{rowNum, 10},
		{rowList, [10, 20, 30]},
		{sortname, 'id'},
		{viewrecords, true},
		{sortorder, <<"desc">>},
		{caption, <<"JSON Example">>}
	    ],
	    actions = [#jqgrid_event{trigger = jqgrid, target = jqgrid, type = ?ONSELECTROW}]
	}
    ].
<commit_msg>add oncellselect<commit_after>% Nitrogen Elements Examples
% Copyright (c) 2013 <NAME> (<EMAIL>)
% See MIT-LICENSE for licensing information.

-module(grid).

-include_lib("nitrogen_elements/include/nitrogen_elements.hrl").
-compile(export_all).

body() ->

    %% wf:wire(jqgrid, #jqgrid_event{type = ?ONSELECTROW, postback = jqgrid }),
    %% wf:wire(jqgrid, #jqgrid_event{type = ?ONSELECTROW, event_name="myEvent"}),
    %% wf:wire(jqgrid, #jqgrid_event{type = ?ONCELLSELECT, event_name="myEvent"}),

    [
	#jqgrid{
	    id = jqgrid,
	    options=[
		{url, 'get_jqgrid_data'},
		{datatype, <<"json">>},
		{colNames, ['ID', 'Name', 'Values']},
		{colModel, [
		    [{name, 'id'}, {index, 'id'}, {width, 55}],
		    [{name, 'name'}, {index, 'name1'}, {width, 80}],
		    [{name, 'values1'}, {index, 'values1'}, {width, 100}]
		]},
		{rowNum, 10},
		{rowList, [10, 20, 30]},
		{sortname, 'id'},
		{viewrecords, true},
		{sortorder, <<"desc">>},
		{caption, <<"JSON Example">>}
	    ],
	    actions = [
		#jqgrid_event{trigger = jqgrid, target = jqgrid, type = ?ONSELECTROW},
		#jqgrid_event{trigger = jqgrid, target = jqgrid, type = ?ONCELLSELECT}
	    ]
	}
    ].

{'fraction_non_alphanumeric': 0.21549421193232413, 'fraction_numerical': 0.019590382902938557, 'mean_word_length': 4.17741935483871, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3544270', 'n_tokens_mistral': 979, 'n_tokens_neox': 859, 'n_words': 175}