User Profile & Activity

Roger Chen Member
Page
of 3

When i disable SmartWebResources (doesn't use SmartWebResources) and set the path like below:

 <add key="ISNet.WebUI.WebGrid.v10_0_7200.RenderingMode" value="HTML5" />

  <add key="ISNet.WebUI.WebGrid.v10_0_7200.ScriptDirectory" value="~/CommonLibrary/WebGrid/V10_0_7200/" />  <add key="ISNet.WebUI.WebGrid.v10_0_7200.ImagesDirectory" value="~/CommonLibrary/Images/" />
  <add key="ISNet.WebUI.WebGrid.v10_0_7200.SharedScriptDirectory" value="~/CommonLibrary/Shared/" />
  <add key="ISNet.WebUI.WebGrid.v10_0_7200.WebDesktopScriptDirectory" value="~/CommonLibrary/WebDesktop/V5_0_7200/" />
  <add key="ISNet.WebUI.WebGrid.v10_0_7200.LocalizationDirectory" value="~/CommonLibrary/WebGrid/V10_0_7200/Localization/" />
  <add key="ISNet.WebUI.WebGrid.v10_0_7200.HelpURL" value="~/Help/h_webgrid.html" />

 and set Common Library folder in IIS,

but some image do not show,see attach file



webgrid_ui.js can modify, but How to update ISNet.WebUI.WebGrid.Resources.dll file. Thanks

Posted: September 16, 2015 5:21 AM

the first problem attach is uploaded.

About the second problem,we use Intersoft 2014,WebInput 4.0.7200.253 version.Is it different from yours?

I can solution this issue, js code like this:

        // 一键折叠或一键展开        function doCollapseExpand(ctl) {
            var grid = ISGetObject("wg_cwbt");

            if (ctl.value == "一键折叠") {
                document.getElementById("hid_expand_flag").value = "0";
                ctl.value = "一键展开"

                // select the first row
                var rowCount = grid.RootTable.GetRowsCount();

                for (var i = 0; i < rowCount; i++) {
                    var row = grid.RootTable.GetRow(i);
                    if(row != null)
                    {
                        if (row.IsSelfRefRow) { // && SelfRefExpanded
                            row.CollapseSelfRefRow();
                        }
                    }
                }
            }
            else {
                document.getElementById("hid_expand_flag").value = "1";
                ctl.value = "一键折叠"

                grid.Refresh();
            }
            return;
        }

Regards,

RogerChen

thank you for your reply, i use js code like this:

    // 一键折叠或一键展开        function doCollapseExpand(ctl) {
            var grid = ISGetObject("wg_cwbt");

            if (ctl.value == "一键折叠") {
                document.getElementById("hid_expand_flag").value = "0";
                ctl.value = "一键展开"

                // select the all row
                var rowCount = grid.RootTable.GetRowsCount();

                for (var i = 0; i < rowCount; i++) {
                    var row = grid.RootTable.GetRow(i);

                    // only expand the first row if :
                    // 1) It's a SelfReference row type
                    // 2) It has been expanded
                    if(row.IsSelfRefRow != null)
                    {
                        if (row.IsSelfRefRow) { // && SelfRefExpanded
                            row.CollapseSelfRefRow();
                        }
                    }
                }
            }
            else {
                document.getElementById("hid_expand_flag").value = "1";
                ctl.value = "一键折叠"

                grid.Refresh();
            }
            return;
        }

 but only first row collapsed, see attachment file.

Regards,

RogerChen

Posted: May 15, 2012 3:29 AM

Bernard, thank you for you reply!

I'm not use SmartWebResources because of files in "WebGrid\V7_0_7200\Localization" changed. i translate "wglang_zh-CN.xml" file by myself. it different with "wglang_zh-CN.xml" in SmartWebResources dll.

Regards,

Roger

Posted: May 15, 2012 3:28 AM

Hans, thank you for you reply, i'm not use  SmartWebResources because of files in "WebGrid\V7_0_7200\Localization" changed. i translate "wglang_zh-CN.xml" file by myself. it differently with "wglang_zh-CN.xml" in SmartWebResources dll.

 

Regards,

Roger

Posted: April 27, 2012 9:26 PM

Hans, thanks for you reply, i set AutomaticFilter="false" in page "A", then add follow code

        protected void wegbrid1_CustomFilter(object sender, FilterEventArgs e)
        {
            // save filter state
            Session["ses_filter_columns"] = wegbrid1.RootTable.FilteredColumns;
        }

in Page_Load event add follow code

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
            if (Session["ses_filter_columns"] != null)
            {
                WebGridFilterCollection wgfc = (WebGridFilterCollection)Session["ses_filter_columns"];

                int iFilterCount = wgfc.Count;
                for (int i = 0; i < iFilterCount ; i++)
                {
                    webgrid1.RootTable.FilteredColumns.Add(wgfc[i]);
                }
            }
    }
}

the data of page "A" display ok when return page "B", but the filter text of FilterBar disappear.

so i want to show filter text and filter type i selected.

 

Regards,
Roger

Posted: April 27, 2012 9:07 PM

bernard, thanks for you reply. i remove code remarks.

(!groupRow.GroupExpanded) {
     groupRow.ExpandGroupRow();
     btnExpandGR.disabled = true

}

then set IE ignore javascript error, it can be good in my scenario. hope the next version has this feature.

 

 

Regards,
Roger 

Posted: April 27, 2012 2:20 AM

thanks, i want to restore the group nodes state when after sort or refresh, my code is

        function wg_expense_GroupExpand(controlId, tblName, groupIndex, rowPosition, rowIndex) {
            StoreExpandedGroupNode(rowPosition, true);
            return true;
        }

        function wg_expense_GroupCollapse(controlId, tblName, groupIndex, rowPosition, rowIndex) {
            StoreExpandedGroupNode(rowPosition, false);
            return true;
        }

        function wg_expense_AfterResponseProcess(controlId, actionName, lastRequestObject, xmlResponseObject) {
            var grid = ISGetObject(controlId);
            //if  ColumnSort or Refresh action or LoadGroup or ColumnFilter, restore the group nodes state
            if (actionName == "Refresh" || actionName == "ColumnSort" || actionName == "LoadGroup" || actionName == "ColumnFilter") {

                var v_expandedGroupNodes = document.all["hid_expandedGroupNodes"];
                if (v_expandedGroupNodes.value != "") {
                    var RowInfo = v_expandedGroupNodes.value.split(";");

                    for (var i = 0; i < RowInfo.length; i++) {
                        var Row = RowInfo[i];
                        var groupRow = grid.RootTable.GetRowByGroup(0, Row)
                        if (!groupRow.GroupExpanded) {
                            groupRow.ExpandGroupRow();
                            //btnExpandGR.disabled = true; here need some code insure effect   
                            //btnCollapseGR.disabled = false;
                        }
                    }
                }
            }

            return true;
        }

        function StoreExpandedGroupNode(RowIndex, action) {
            var v_expandedGroupNodes = document.all["hid_expandedGroupNodes"];
            if (action) {  // Expanded
                if (v_expandedGroupNodes.value == "")
                    v_expandedGroupNodes.value = RowIndex;
                else {
                    // not exist,need add。
                    if (!groupRowExist(v_expandedGroupNodes.value, RowIndex))
                        v_expandedGroupNodes.value += ";" + RowIndex;
                }
            }
            else {
                //obtain the information about RowPosition delimited by ";"
                var RowInfo = v_expandedGroupNodes.value.split(";");
                var expandedGroupNodesTemp = "";

                //compare it with current RowIndex of collapsed group node
                for (var i = 0; i < RowInfo.length; i++) {
                    var Row = RowInfo[i];

                    if (RowIndex != Row) {
                        if (expandedGroupNodesTemp == "")
                            expandedGroupNodesTemp = RowInfo[i];
                        else
                            expandedGroupNodesTemp += ";" + RowInfo[i];
                    }
                }

                v_expandedGroupNodes.value = expandedGroupNodesTemp;
            }
        }

        // 
        function groupRowExist(expandedGroupNodes, RowIndex) {
            var v_exist = false;
            var RowInfo = expandedGroupNodes.split(";");

            for (var i = 0; i < RowInfo.length; i++) {
                var Row = RowInfo[i];
                // 
                if (RowIndex == Row) {
                    v_exist = true;
                    break;
                }
            }

            return v_exist;
        }

so I don't understand "ExpandGroupRow function not working because you don’t have any event that trigger this function",

 

All times are GMT -5. The time now is 1:57 AM.
Previous Next