Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8920929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:24:15+00:00 2026-06-15T06:24:15+00:00

Normally we call onSelectRow function like: $(#imports_grid).jqGrid({ // jqGrid settings url: url, datatype: json,

  • 0

Normally we call onSelectRow function like:

$("#imports_grid").jqGrid({
    // jqGrid settings
    url: url,
    datatype: "json",
    colNames: cnames,
    colModel: cmodel,
    onSelectRow: function() {
      // Code
    },
});

My PHP script outputs jqGrid settings using json_encode() so it looks like

$script = '$("#imports_grid").jqGrid(' . json_encode($js_settings) . ');';
// echo $script;

In this case, onSelectRow’s function does not work.

Is there an alternative method to fire function inside onSelectRow?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T06:24:16+00:00Added an answer on June 15, 2026 at 6:24 am

    You don’t need to mix HTML code and JavaScript code inside of PHP script. Instead of that you can place <script> element

    <script type="text/javascript" src="theURL.js"></script>
    

    in the PHP script. The JavaScript code you can place in the .JS file.

    UPDATED: You can make of cause a mix between inline JavaScript code where you set some global variables and the JS file where you use the variables:

    in PHP code you use

    <script type="text/javascript">
        var MYGLOBALSETTINGS = {
            cnames: ["Column 1", "Column 2", ...],
            cmodel: [{...}, {...}...],
            url: "myUrl"
        };
    </script>
    <script type="text/javascript" src="my.js"></script>
    

    and in my.js you just use MYGLOBALSETTINGS.cnames and MYGLOBALSETTINGS.cmodel

    $("#imports_grid").jqGrid({
        // jqGrid settings
        url: MYGLOBALSETTINGS.url,
        datatype: "json",
        colNames: MYGLOBALSETTINGS.cnames,
        colModel: MYGLOBALSETTINGS.cmodel,
        onSelectRow: function() {
          // Code
        },
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Normally, I call my function like so: SELECT * FROM TABLE( package_name.function(parameters) ) I'm
I have ToggleActive in C#, and, normally I can call it like ToggleActive where
I would like to call a jQuery pager function (p) defined as: function p(page)
I have a question for you! Normally, if you call a callback function within
In case a system call function fails, we normally use perror to output the
Say for example, using javascript i would normally call a method like this <a
Normally you make a call to a service, it blocks until a thread in
I am wondering where to call the ShowDialog() in MVP pattern, Presenter is normally
Normally the XML files I have to parse are like this: <row id=1> <title>widget<title>
I have a globalish variable which is $VARcurrenttime = time(); then I normally call

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.