小编Ami*_*din的帖子

通过angular指令将布尔值转换为yes/no

我需要使用指令将布尔值显示为yes/no.我的指示如下

 directives.directive('niBooltoYesno',
        function () {
            return {
                restrict: 'EA',
                require: 'ngModel',
                link: function (scope, element, attrs, ngModel) {
                    function formatter(value) {
                        if (value) {
                            return value === true ? 'Yes' : 'No';
                        } else {
                            return '';
                        }
                    }
                    ngModel.$formatters.push(formatter);

                }
            };
        });

<ni-boolto-yesno data-ng-model="set_unit.isActive" ></ni-boolto-yesno>
Run Code Online (Sandbox Code Playgroud)

但它不起作用.请帮助我.

angularjs

16
推荐指数
2
解决办法
3万
查看次数

为什么嵌套的ng-grid高度不起作用?

我有一个嵌套的ng网格.

var faculty = angular.module('faculty', ['ngGrid']);

faculty.controller('facultycontroller', function facultycontroller($scope, $http, $window)
{

$scope.facdata = [{

    examname: 'test'       
  },{

    examname: 'test2'
  }];

  $scope.gridOptions = {

    data: 'facdata',

    plugins: [new ngGridFlexibleHeightPlugin()],

    columnDefs: [
      {field: 'examname',displayName: 'Exam Name'},
      {field: '', displayName: 'Subjects' , cellTemplate: '<div  ng-grid="gridOptions1"  ></div>'
    }]
  };
$scope.fac1data = [{
    abc: 'value',
    def: 'value2'
  }, {

    abc: 'value3',
    def: 'value4'
  }, {
    abc: 'value1',
    def: 'value4'
  }, {
    abc: 'value2',
    def: 'value4'
  }, {
    abc: 'value34',
    def: 'value4'
  }, {

    abc: …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs ng-grid

8
推荐指数
1
解决办法
1524
查看次数

Android Webview中的loadUrl()失败,出现net :: ERR_CACHE_MISS

我在android studio中工作。我已经在主要活动中使用了webview。当我运行我的项目时,它会显示类似以下错误:“由于以下原因,无法加载http://www.google.com上的网页:net :: ERR_CACHE_MISS”。请查看我的代码:在清单中:

<application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".defaultActivity"
            android:label="@string/app_name"
          >
            <uses-permission android:name="android.permission.INTERNET"/>
            <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
            <uses-permission android:name="android.permission.android.permission.ACCESS_NETWORK_STATE"/>
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
Run Code Online (Sandbox Code Playgroud)

活动中:

WebView _taskOrganizerView = null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_default);
        _taskOrganizerView =   (WebView)findViewById(R.id.wvTskOrg);
        _taskOrganizerView.getSettings().setJavaScriptEnabled(true);
        if (Build.VERSION.SDK_INT >= 19) {
            _taskOrganizerView.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);
        }
        _taskOrganizerView.loadUrl("http://www.google.com");
        _taskOrganizerView.setWebViewClient(new WebViewClient() );
    }
Run Code Online (Sandbox Code Playgroud)

在版式中:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".defaultActivity">

    <WebView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/wvTskOrg"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true"
        android:layout_alignParentTop="true" …
Run Code Online (Sandbox Code Playgroud)

android webview

4
推荐指数
1
解决办法
1万
查看次数

输入类型按钮时打开文件对话框

在html中我们知道使用输入类型文件我们得到文件对话框来选择文件.有没有办法使用输入类型按钮打开文件对话框?我们用了

<input type="file" class="file" name="attachement" />
Run Code Online (Sandbox Code Playgroud)

但我想用

<input type="button" class="file" name="attachement" />
Run Code Online (Sandbox Code Playgroud)

html javascript

3
推荐指数
2
解决办法
3万
查看次数

防止angularjs中的多次单击

当我想从我的页面删除记录时,我需要在删除之前显示确认消息.为此,我使用了锚并ng-click='delete()'删除了这样的行.在这里,用户可以多次点击锚点.这是一个严重的问题,因为确认弹出窗口会多次呈现.我的例子是一个样本.在我的项目中,我遇到了太多这样的问题.我想阻止多次点击扩展ng-click.

html angularjs

3
推荐指数
1
解决办法
1万
查看次数

如何在 asp.net 中将 RDLC 报告导出为 .xlsx 格式?

在rdlc报告中,我想将rdlc报告导出为ex​​cel格式2007,即.xlsx格式。我编写了以下代码来获得这样的输出。但系统产生.xls 格式。请在这一点上帮助我。

private void PopulateReport(List<OrderDetail> objectList, string datasetName, string reportPath, out string mimeType, out byte[] renderedBytes, decimal fileWidth, decimal fileHeight)
        {
                LocalReport localReport = new LocalReport();
            localReport.ReportPath = Server.MapPath(reportPath);
                ReportDataSource reportDataSource = new ReportDataSource(datasetName, objectList);
            localReport.DataSources.Add(reportDataSource);

            //localReport.SetParameters(new ReportParameter("pm", "", false));    
            string reportType = "excel";
            mimeType = string.Empty;
            string encoding = string.Empty;
            string fileNameExtension = string.Empty;
            //The DeviceInfo settings should be changed based on the reportType
            string deviceInfo =

            "<DeviceInfo>" +

            "  <OutputFormat>PDF</OutputFormat>" +

            "  <PageWidth>" + fileWidth + "in</PageWidth>" + …
Run Code Online (Sandbox Code Playgroud)

c# asp.net excel rdlc

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

angularjs ×3

html ×2

javascript ×2

android ×1

asp.net ×1

c# ×1

excel ×1

ng-grid ×1

rdlc ×1

webview ×1