Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - STEVE

Pages: [1] 2 3 4
1
Help for ParamQuery Pro / Re: Paging of the tree grid
« on: October 13, 2022, 06:49:19 pm »
I couldn't make it.  Sorry for that.
It was really difficult for me to understand to adopt your sample code and guide.

This code seems to have a problem I can't understand.
Quote
var url = 'treegrid?fid=' + node.fid;

I just met the endless cycling of clock sticks.

I need a parent node and his children ranked as level 2 from the first query.
And then expand one of the nodes. I think it is a lazy query.

What should I do now?  Please guide me.

Code: [Select]
<?php    require_once '../grid/include.php';    include 'include/dropdown.php';    ?>

<script>
$(function () {

function getChanges(grid) {           
    return grid.getChanges({ format: 'byVal' });                   
}

function saveChanges() {           
    var grid = this;
    //attempt to save editing cell.
    if (grid.saveEditCell() === false) {
        return false;
    }
       
    if ( grid.isDirty() && grid.isValidChange({ focusInvalid: true }).valid ) {

        var changes = getChanges(grid), Tree = grid.Tree();

        //post changes to server, assign unique id to rows in addList
        changes.addList.forEach(function( rd ){
            //rd.id = Math.random() * Math.random();
            Tree.updateId(rd, Math.random() * Math.random());
        })           

        //and commit in grid, refer to batch editing example.           
        grid.commit({
            type: 'add',
            rows: changes.addList
        });

        grid.commit();
       
    }

    grid.History().reset();
}

var obj = {       
    height: 'flex',
    //rowHt: 33, autoRow: false,
    maxHeight: 500,               
    numberCell: {width: 50},
    dragModel: {
        on: true,
        diHelper: ['fnm'],
        /*dragNodes: function (rd, evt) {
            var checkNodes = this.Tree().getCheckedNodes();
            return (checkNodes.length && checkNodes.indexOf(rd) > -1) ? checkNodes : [rd];
        },*/
        isDraggable: function (ui) {
            return !ui.rowData.pq_gsummary;
        }
    },
    dropModel: {
        on: true,
        divider: 200, //v7.4
        isDroppable: function (evt, uiDrop) {

            var Drag = uiDrop.helper.data('Drag'),
                uiDrag = Drag.getUI(),
                rdDrag = uiDrag.rowData,
                rdDrop = uiDrop.rowData,
                Tree = this.Tree(),
                denyDrop = (
                    rdDrop == rdDrag ||
                    (rdDrop && rdDrop.pq_gsummary) ||
                    (rdDrop && Tree.isAncestor(rdDrop, rdDrag))
                );

            return !denyDrop;
        }
    },
    //filterModel: { on: true, mode: "AND", header: true },
    menuIcon: true,
    stripeRows: false,
    toolbar: {
        items: [
            {
                type: 'button', icon: 'ui-icon-plus', label: 'Root node', listener: function () {                     
                    var grid = this,
                        ri,
                        newRow = { id: "new_" + Math.random(), fnm: "new item" };

                    grid.Tree().addNodes([newRow])

                    //get rowIndx of newly inserted row.
                    ri = grid.getRowIndx({ rowData: newRow }).rowIndx;

                    grid.scrollRow({ rowIndx: ri }, function () {
                        grid.editFirstCellInRow({ rowIndx: ri })
                    });
                }
            },
            {
                type: 'button', icon: 'ui-icon-plus', label: 'Child node', listener: function () {                       
                    var grid = this,
                        sel = grid.Selection().getSelection(),
                        parent;

                    if (sel.length && (parent = sel[0].rowData) ){                           
                        var newRow = { id: "new_" + Math.random(), fnm: "new item" };

                        grid.Tree().expandNodes( [ parent ] );

                        //append new node to selected parent.
                        grid.Tree().addNodes([ newRow ], parent);

                        //get rowIndx of newly inserted row.
                        var ri = grid.getRowIndx({ rowData: newRow }).rowIndx;
                        grid.scrollRow({ rowIndx: ri }, function () {
                            grid.editFirstCellInRow({ rowIndx: ri })
                        });                           
                    }
                    else {
                        alert("Select parent node");
                    }
                }
            },
            { type: 'separator' },
            {
                type: 'button',
                icon: 'ui-icon-disk',
                label: 'Save',
                cls: 'changes',
                listener: saveChanges,
                options: { disabled: true }
            },
            {
                type: 'button',
                icon: 'ui-icon-cart',
                label: 'Get Changes',
                cls: 'changes',
                listener: function () {
                    var changes = getChanges(this);                       
                    if( console && console.log) {
                        console.log(changes);
                    }                           
                    alert("Please see the log of changes in your browser console.");                       
                },
                options: { disabled: true }
            },
            { type: 'separator' },
            { type: 'button', icon: 'ui-icon-arrowreturn-1-s', label: 'Undo', cls: 'changes', listener: function () {
                    this.History().undo();
                },
                options: { disabled: true }
            },
            { type: 'button', icon: 'ui-icon-arrowrefresh-1-s', label: 'Redo', listener: function () {
                    this.History().redo();
                },
                options: { disabled: true }
            },
            {
                    type: 'button',
                    label: "Export",
                    icon: 'ui-icon-arrowthickstop-1-s',
                    listener: function () {
                        this.exportData({
                            url: "exportData.php",
                            format: "xlsx",
                            render: false
                        });
                    }
                    }
        ]
    },
   
    title: "<b>기능분해도</b>",

    history: function (evt, ui) {
        var $tb = this.toolbar();
        if (ui.canUndo != null) {
            $("button.changes", $tb).button("option", { disabled: !ui.canUndo });
        }
        if (ui.canRedo != null) {
            $("button:contains('Redo')", $tb).button("option", "disabled", !ui.canRedo);
        }
        $("button:contains('Undo')", $tb).button("option", { label: 'Undo (' + ui.num_undo + ')' });
        $("button:contains('Redo')", $tb).button("option", { label: 'Redo (' + ui.num_redo + ')' });
    },
    treeModel: {
        dataIndx: 'fnm',
        id: 'fid',
        parentId: 'fidp'
    },
    sortModel: {ignoreCase: true},
    scrollModel: { horizontal: true  },         //autoFit: true
    // columnTemplate: { minWidth: '10%', maxWidth: '80%', width: 100 },
    //selectionModel: {mode: 'single', type:'row'},
   
    // beforeTreeExpand: function(evt, ui){
    //         //debugger;
    //         var grid = this, tree = grid.Tree();
    //         ui.nodes.forEach(function( node ){
    //             //node is collapsed and children nodes are not added yet.
    //             if( tree.isCollapsed( node ) && !node._nodesAdded){
    //                 grid.showLoading();
                       
    //                 var url = 'treegrid?fid=' + node.fid;

    //                 $.getJSON(url, function( response ){
    //                     //debugger;
    //                     node._nodesAdded = true;         
    //                     tree.addNodes(response.data, node);
    //                     grid.hideLoading();
    //                 });                   
    //             }
    //         })
    //     },
    colModel: [
        {dataIndx: 'id', title: 'ID', dataType: 'string' , width: 70, hidden: true },
        {dataIndx: 'seq', title: '순번', dataType: 'string', width: 70 },
        {dataIndx: 'ocd', title: '기관', dataType: 'string', width: 70 },
        {dataIndx: 'scd', title: '시스템', dataType: 'string', width: 80 },
        {dataIndx: 'lvl', title: '수준', dataType: 'string', width: 70 },
        {dataIndx: 'fid', title: '기능ID', dataType: 'string', width: 130 },
         {
            dataIndx: 'fnm', title: '기능명', align: "center",
            // validations:[{
            //     type: 'minLen', value: 1, msg: "Required"
            // }],
            exportRender: true,
            minWidth: 500
        },
        {dataIndx: 'ep', title: '끝', dataType: 'string', width: 70 },
        //
        { title: "기능설명", width: 300, dataType: "string", dataIndx: "fdsc" },
        { title: "연관시스템", width: 80, dataType: "string", dataIndx: "isys" },
        { title: "수행조직", width: 100, dataType: "string", dataIndx: "actr" },
        { title: "작성자", width: 80, dataType: "string", dataIndx: "wrkr" , hidden: true },
        { title: "자동화여부", width: 80, dataType: "string", dataIndx: "aut" },
        { title: "공통여부", width: 80, dataType: "string", dataIndx: "cmyn" },
        { title: "흐름반영여부", width: 80, dataType: "string", dataIndx: "flyn" },
        { title: "기능유형", width: 100, dataType: "string", dataIndx: "trx" },
        { title: "비고", width: 300, dataType: "string", dataIndx: "rmk" },
        //
        {dataIndx: 'fidp', title: '부모기능ID', dataType: 'string', width: 150 , hidden: true },   // parent of fid   
        { title: "", editable: false, minWidth: 83, sortable: false,
            menuInHide: true,
            render: function (ui) {
                if( !ui.rowData.pq_gsummary )
                    return "<button type='button' class='delete_btn'>Delete</button>";
            },
            postRender: function (ui) {
                var rowIndx = ui.rowIndx,
                    grid = this,
                    $cell = grid.getCell(ui);

                $cell.find("button").button({ icons: { primary: 'ui-icon-scissors'} })
                .bind("click", function () {

                    grid.addClass({ rowIndx: ui.rowIndx, cls: 'pq-row-delete' });

                    setTimeout(function () {
                        var ans = window.confirm("Are you sure to delete row No " + (rowIndx + 1) + "?");
                        grid.removeClass({ rowIndx: rowIndx, cls: 'pq-row-delete' });
                        if (ans) {
                            //grid.deleteRow({ rowIndx: rowIndx });
                            grid.Tree().deleteNodes([ui.rowData]);
                        }
                    })
                });
            }
        }
    ],
    postRenderInterval: -1, //call postRender synchronously.       
    create: function(){
        this.widget().pqTooltip();
    },
    complete: function () {
        this.flex({dataIndx:['fnm']});
    },
    collapsible: {on: false},
    dataModel: {
        dataType: "JSON",             
        location: 'remote',
        recIndx: "id",
        url: "ab01db.php"
        // ,
        // getData: function(response){               
        //     return {data: response};
        // }   
    },
    trackModel: {on: true},
    showTitle: true ,
    pasteModel: {type:"replace"} //don't want new rows from pasted data.
}
pq.grid( "#tree_grid", obj);

});     
</script>
</head>
  <body>
    <div id="tree_grid" style="margin: auto;">
    </div>
  </body>
</html>   
   

2
Help for ParamQuery Pro / Re: cellDblClick Sample Codes
« on: October 13, 2022, 05:47:48 pm »
Thank you~

By the way, I need two columns like the below code.

Code: [Select]
var url = "HTTP://xxx.xxx.xxx.:9090/" + ui.rowData[ ui.dataIndx('pkg') + "/" + ui.dataIndx('pid')] ;

 Is it able to use this way?

 Or is there any other way?

3
Help for ParamQuery Pro / Re: cellDblClick Sample Codes
« on: October 13, 2022, 07:41:11 am »
Thank you for your response.

By the way, I want to know how to fix the column to double-click,
Or when only the PID column was clicked, new windows would pop up.

How to change the below code with two column values?
Code: [Select]

var url = ui.rowData[ ui.dataIndx ];


Quote
{ title: "패키지", width: 200, dataType: "string", dataIndx: "pkg" },
{ title: "프로그램ID", width: 200, dataType: "string", dataIndx: "pid" },

4
Help for ParamQuery Pro / cellDblClick Sample Codes
« on: September 21, 2022, 08:43:27 pm »
Hello paramvir?

I want to know how to go to the target URL when the cell were double clicked.

I guess below code will be answered to my question. 

But, I don't understand it at all.  I need good examples.   

Would you help me to get the good sample codes?

Code: [Select]

cellDblClick( event, ui )Type: pqGrid:cellDblClick

Triggered when a cell is double clicked in pqGrid.

event
Type: Event
ui
Type: Object
rowData
Type: Object
Reference to 1-dimensional array or object representing row data.
rowIndx
Type: Integer
Zero based index of the row.
dataIndx
Type: Integer or String
Zero based index in array or key name in JSON.
colIndx
Type: Integer
Zero based index of the column corresponding to cell.
Code examples:

Initialize the pqGrid with the cellDblClick callback specified:

1
2
3
$( ".selector" ).pqGrid({
    cellDblClick: function( event, ui ) {}
});

Bind an event listener to the pqGrid:cellDblClick event:

1
$( ".selector" ).on( "pqGrid:cellDblClick", function( event, ui ) {} );

5
Help for ParamQuery Pro / Paging of the tree grid
« on: September 21, 2022, 08:24:29 pm »
Hello  Paramvir?

I found that the speed of the web page of the tree grid was too slow.

Are there ways to get the data from the database for only one or two pages at the first time?

It seems to have no way to page the data from the fetch of the query.

Best regards,
Steve.

6
Help for ParamQuery Pro / Re: Tree Batch Editing - Doesn't Work
« on: September 21, 2022, 08:16:18 pm »
I am waiting

7
Help for ParamQuery Pro / Re: Tree Batch Editing - Doesn't Work
« on: August 26, 2022, 06:07:51 pm »
I am sorry to say that it didn't work at all.

8
Help for ParamQuery Pro / Re: I need to switch from PHP to Java.
« on: August 24, 2022, 03:59:16 am »
Please help me~~~

9
Help for ParamQuery Pro / Re: I need to switch from PHP to Java.
« on: August 24, 2022, 03:56:51 am »
I forgot something important.

I got the error message from the eclipse console.

it was that "pgConn/product/gets" can not be resolved ..."

You gave me some advice to use the URL, "/product/gets"

I want to know the mechanism of the using URL between the Controller and JSP.

Thank you in advance.

10
Help for ParamQuery Pro / Re: I need to switch from PHP to Java.
« on: August 24, 2022, 02:30:17 am »

Hello?

I put the sample code of the product example in the webapp folder which is working on the tomcat.

I got an error message like this when I click the new button on the product sample code.


Code: [Select]

jquery.min.js:5

GET http://localhost:8081/product/get?pq_datatype=JSON&_=1661285986779 404


I want to know the reason why "pgConn" is disappeared.

Quote

http://localhost:8081/pgConn/product


And Why it doesn't work?


11
Help for ParamQuery Pro / Re: I need to switch from PHP to Java.
« on: August 23, 2022, 07:50:56 am »
I have trouble with a JSP file.

The CSS and JS files were not included

Code: [Select]

    <link rel="stylesheet" href="../css/jquery-ui.css" />
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/query-ui.min.js"></script> 


I put the json_exam.jsp file in the views folder beside the grid folder.
It works fine.

Quote
http://localhost:9080/aa/json_exam.jsp
-->
//localhost:9080/grid/ajax/jquery-ui.min.js

It is from the tomcat initiated with the eclipse tool.
It doesn't work due to an incorrect URL
Quote
http://localhost:8081/pgConn/json
--> it call json_exam.jsp file
--> this file refers to the js file below
http://localhost:8081/pgConn/js/jquery.min.js
--> 404 Error

Would you tell me how set the correct URL with some configuration in eclipse?

Please help me~

Many thanks for considering my request.

12
Help for ParamQuery Pro / Re: I need to switch from PHP to Java.
« on: August 21, 2022, 04:00:42 pm »
Hello?

I changed some codes. 
Please check the below files

My questions are so simple regarding these files.

I want to know how to set the value of the URL of Ajax from pqGrid.

It really is difficult to match each other.

from product.jsp

Code: [Select]
$.ajax({
                dataType: "json",
                type: "POST",
                async: true,
                beforeSend: function (jqXHR, settings) {
                    grid.showLoading();
                },
                url: "/aa/products/batch",                    //for ASP.NET, java
                data: { list: JSON.stringify(changes) },

to productController.java

Code: [Select]

@RequestMapping(value="/Products/clear", method=RequestMethod.GET)
    public @ResponseBody String clear(HttpServletRequest request ){
        HttpSession ses = fillInSession(request);
        //ses.setAttribute("Products", "");
        @SuppressWarnings("unchecked")
        List<Products> Products = (List<Products>)ses.getAttribute("Products");
        Products.clear();
        return "";
    }


Code: [Select]
@RequestMapping(value="/Products/batch", method=RequestMethod.POST)
    public @ResponseBody String batch(@RequestParam String list, HttpServletRequest request ){
        HttpSession ses = fillInSession(request);

        Map<String, List<Products>> dlist = deserializeMap(list);

        ArrayList<Products> updateList = (ArrayList<Products>)dlist.get("updateList");
        ArrayList<Products> addList = (ArrayList<Products>)dlist.get("addList");
        ArrayList<Products> deleteList = (ArrayList<Products>)dlist.get("deleteList");

        this.updateList(updateList, ses);
        this.addList(addList, ses);
        this.deleteList(deleteList, ses);

        return serializeMap(dlist);
    }

Code: [Select]
@RequestMapping(value="/Products/get",method=RequestMethod.GET)
    public @ResponseBody String Products(ModelMap model, HttpServletRequest request ){

        HttpSession ses = fillInSession(request);

        @SuppressWarnings("unchecked")
        List<Products> products = (List<Products>)ses.getAttribute("Products");

        String serializedProducts = serialize(products);

        String responseStr = "{\"data\":" + serializedProducts + "}";
        return responseStr;
    }

13
Help for ParamQuery Pro / Re: I need to switch from PHP to Java.
« on: August 19, 2022, 08:57:29 pm »
I am trying to modify your sample java code.

I couldn't make it work.

I am attaching the files and two screenshots.

Its pattern is the MVC pattern. 

Please check my files.

if you could give me the executable files I will be happy enough.

Thank you.

14
Help for ParamQuery Pro / Re: I need to switch from PHP to Java.
« on: August 19, 2022, 06:51:16 pm »
I changed it as below.

Code: [Select]
public class ProductsListController extends JdbcTemplate {

But Still, the problem exists.
Code: [Select]
List<Product> products = getJdbcTemplate().query(

I have to make a function to resolve this problem
Code: [Select]
private JdbcTemplate getJdbcTemplate() {
// TODO Auto-generated method stub
return null;
}


I had to learn java to implement pqGrid to the existing home page does not support PHP to show the excel data.

I want to keep my promise to them.

But I am afraid to disappoint them.

 

15
Help for ParamQuery Pro / Re: I need to switch from PHP to Java.
« on: August 19, 2022, 06:17:12 pm »
Dear paramvir,

The java code didn't work.  Even I imported these components.

import org.springframework.jdbc.core.support.JdbcDaoSupport;
import org.springframework.jdbc.core.JdbcTemplate;

Error messages are below.

The type org.springframework.dao.support.DaoSupport cannot be resolved. It is indirectly referenced from required .class files


And, I need to know how to set up the pom.xml, web.xml, and servlet-context.xml on this problem.

Thank you.


Pages: [1] 2 3 4